Syed Sayem blog

Connect to Windows 10 Docker Daemon from Ubuntu Bash

I’m assuming you already have Docker and Ubuntu Bash installed in you’re Windows 10 System. If you haven’t done it already, or if you need some guidance on how to install Ubuntu Bash or Docker in your Windows system, just do a Google search “Enable Ubuntu Bash in Windows 10” or “Docker for Windows” and you’ll find plenty of tutorials on how to install Docker and Ubuntu Bash for Windows 10.

After you installed Docker and Ubuntu Bash,

Open the Start Menu and search for ‘Ubuntu’. Now click on the orange circle of doohoo Ubuntu logo to launch Bash on Ubuntu on Windows!

Add your computer name into /etc/hosts file

sudo nano /etc/hosts

Example,

127.0.0.1 localhost SAYEM-PC

Now download Docker for Linux,

$ wget https://get.docker.com/builds/Linux/x86_64/docker-1.13.0.tgz

Extract it,

$ tar -xzvf docker-1.13.0.tgz

Make ~/bin folder and move everything in the ~/bin folder

$ mkdir ~/bin
$ mv docker ~/bin

Open .bashrc and add the following statement

export DOCKER_HOST=localhost:2375
export PATH=$PATH:~/bin

Install docker-compose

$ sudo apt-get install python-pip bash-completion
$ sudo pip install docker-compose

And Bash completion.

$ curl -L https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker > /etc/bash_completion.d/docker
$ curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose

Done!

comments powered by Disqus