Skip to content

Instantly share code, notes, and snippets.

@radu-matei
Last active April 3, 2017 12:33
Show Gist options
  • Save radu-matei/4d8ba87f91c91b05904718857e5c5fc2 to your computer and use it in GitHub Desktop.
Save radu-matei/4d8ba87f91c91b05904718857e5c5fc2 to your computer and use it in GitHub Desktop.

Connect to a Docker Engine from Bash on Ubuntu on Windows

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment