I'm trying to do something fairly non-standard, so I'm not sure how successful I'm going to be.
I've installed "Docker for Windows", and I'm able to use it fine from PowerShell.
I would like to be able to use a proper Linux environment though, so I've installed the new Ubuntu Bash prompt for Windows 10.
I've successfully built the latest Docker client in Ubuntu/Bash. However when I run "docker ps", I get:
Cannot connect to the Docker daemon. Is the Docker daemon running on this host?
I had hoped that it might just work.
Is it possible to connect to a Docker daemon running in Windows from Ubuntu/Bash?
On MacOS go to the whale in the taskbar > Preferences > Daemon > Advanced. You can also start the Docker daemon manually and configure it using flags. This can be useful for troubleshooting problems. Many specific configuration options are discussed throughout the Docker documentation.
I figured it out. It was surprisingly simple. I just had to set the following...
export DOCKER_HOST=tcp://127.0.0.1:2375
This is actually a really cool setup.
A very fast, efficient Docker engine running in a type 2 hypervisor, and a proper Ubuntu-based development environment. Nice :-)
Notice: as @BSalita mentioned in the comment, the Docker service must be running with "Expose daemon on tcp://localhost:2375 without TLS" enabled, which can be found in the general section in Docker Settings (right click on the system tray icon then "Settings..."). This option is not checked by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With