compose: Fig can't connect to DOCKER_HOST=tcp://

On OS X with boot2docker 0.5.4:

$ docker version
Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
Server version: 0.8.0
Git commit (server): cc3a8c8
Go version (server): go1.2
$ ~/bin/boot2docker up
[2014-02-10 21:58:12] boot2docker-vm is already running.
$ echo $DOCKER_HOST
tcp://
$ fig --version
fig 0.2.1
$ fig up
Couldn't connect to Docker daemon at http:/ - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

docker build . worked fine for me, but fig seems unable to handle the tcp:// URL.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 54 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@gregory Found the solution.

1) Change the DOCKER_OPTS in /etc/default/docker to:
DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"

2) Restart docker
sudo restart docker

3) Make sure that docker is running on localhost:4243 
$ netstat -ant  |grep 4243
tcp        0      0 127.0.0.1:4243          0.0.0.0:*               LISTEN

4) Set DOCKER_HOST (.bashrc)
export DOCKER_HOST=tcp://localhost:4243

$ echo $DOCKER_HOST
tcp://localhost:4243 

5) And now
$ fig run web rails new . --force --database=postgresql --skip-bundle

NOTE, I have:

Ubuntu 14.04
Docker version 1.1.2, build d84a070
Fig 0.5.2

Thanks to http://serverascode.com/2014/05/25/docker-shipyard-multihost.html

sudo chmod 666 /var/run/docker.sock

should help (Ubuntu 14.04)

I had the same error, after 15 min of debugging. Turns out all it needs is a sudo 😃 Check out [Create a Docker group] here https://docs.docker.com/engine/installation/linux/ubuntulinux/ to get rid of the sudo prefix.

This helped me: If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!

Hey folks, I just found that doing fig up without sudo resulted in this message whereas sudo fig up did the job. Just wanted to mention to eventually save some of you some head-scratching…