This walkthrough is based on Carlos Rafael Ramirez's awesome answer on Server Fault and will allow you to run the Docker client in the Bash on Ubuntu on Windows user space.
Note that this will only allow you to connect to a remote Docker engine and will not run it inside the Bash on Ubuntu on Windows shell, since it only has a user space (and Docker requires a Linux kernel).
First of all, you need to Install Docker for Windows
- get the Docker Client:
wget https://get.docker.com/builds/Linux/x86_64/docker-1.13.1.tgz
- unarchive it:
tar -xzvf docker-1.13.1.tgz
- navigate to the
docker
folder:cd docker
- create an environment variable to the Docker Engine (in this case to 0.0.0.0):
export DOCKER_HOST=tcp://0.0.0.0:2375
- create an environment variable with the path:
export PATH=$PATH:~/bin
That's pretty much it. From now on (during this Bash session) all docker
commands will be executed against the Docker Engine running on port 2375 of your localhost.