3

I would like to be able to run docker inside the ubuntu on widnows app. But after install the docker toolbox, I get the following error:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 

Has anyone seen this error before? Would I be better just running docker natively on windows?

1 Answer 1

2

Your Docker client does not know your Docker host (as thoroughly explained here).

You need to tell the Docker client where the Docker host is, and you can do that by using the -H option:

$ docker -H localhost:2375 some docker command

If you don't want to type the host every time, you can set up and environment variable called DOCKER_HOST to localhost:2375

$ export DOCKER_HOST=localhost:2375 

But, that environment variable will last only as long as the session does. You would have to set it every time you open bash. So, in order to avoid that, you set that variable in a file called .bash_profile in your home directory, like this:

$ echo “export DOCKER_HOST=localhost:2375” >> ~/.bash_profile 

Also make sure you expose the daemon on Windows which you can achieve in the Settings menu (tab “General”) of Docker for Windows.

Restart the bash console and the DOCKER_HOST variable should be there, just type e. g. docker images to check everything is there.

Sign up to request clarification or add additional context in comments.

3 Comments

I can't actually install docker for windows. I'm running it on windows 10 home edition and apparently docker for windows will only run on windows 10 pro.
This is true: “(The current version of Docker for Windows runs on 64bit Windows 10 Pro, Enterprise and Education (1607 Anniversary Update, Build 14393 or later).” — reference
May you want to dive into Vagrant as a alternative.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.