compose: [Mac] docker-compose won't run due to "Couldn't connect to Docker daemon" error
I’m very confused about how docker-compose is supposed to work on my Mac. Here are the steps I took:
- Installed Docker Toolbox (Docker version 1.8.2)
- Tried to run
docker-compose up
but gotIllegal instruction: 4
error as per #1885 - To fix the issue, I installed
docker-compose
with pip viasudo pip install -U docker-compose
- Now when I run
docker-compose up
I getCouldn't connect to Docker daemon - you might need to run
boot2docker up.
Which is very confusing because all the documentation says that boot2docker
is deprecated. And trying to install boot2docker isn’t working for me either.
I’m not sure what else to try. Currently have docker-compose v1.4.2 installed.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 6
- Comments: 31
Commits related to this issue
- Closes #167 Add installation info about Compose issue Issue: https://github.com/docker/compose/issues/2180#issuecomment-207789989 — committed to diegodurli/x-map by diegodurli 8 years ago
We recently fixed this error message (the fix will be in the next release).
It should say “you might need to run
docker-machine start default
”.If you still can’t connect, and the
docker-machine
is running, you can configure compose to use the machine witheval "$(docker-machine env default)"
Ok thanks. Looks like my issue is with the Docker VM. It’s giving me all sorts of TLS errors even when running regular docker commands like
docker images
.I’ll take it up with the docker team.
UPDATE
For anyone also having this issue. The solution for me was to:
Docker Quickstart Terminal
appdocker-machine restart default
eval $(docker-machine env default)
Apparently you need to run the
eval $(docker-machine env default)
every time you run the quick start terminal.I’d just like to add something for anyone who visits this in the future… I keep having this issue every time I open a new shell, so I added
eval $(docker-machine env default)
to my~/.bash_profile
. Works a treat. Of course, someone here may tell me that this is a Very Bad Idea ™ 😄I’m still not totally happy with the solution of adding
eval $(docker-machine env default)
to~/.bash_profile
(even though I proposed it) as it adds about a 2s delay onto opening a new terminal window. Anyone have any better ideas?Yes. Compose will use whatever engine is set in the
DOCKER_HOST
environment variable (which is what gets set byeval $(docker-machine env ....)
.eval "$(docker-machine env default)"
solves the issueeval $(docker-machine env default)
works for me ! thanks 😃"Error checking TLS connection: machine does not exist"
now getting this issue whenever i try to use docker-machine env default , tried loading from the bash_profile too , need help !paste the command: eval “$(docker-machine env default)” on your mac terminal
this issue still persist , the only solution is to use