Skip to content

Fig can't connect to DOCKER_HOST=tcp:// #88

Closed

Description

@stefanw

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.

Activity

  1. aanand commented on Feb 10, 2014

    @aanand

    Yeah, we need to fall back to localhost and 4243 as appropriate when the host and/or port isn't specified. For now, setting DOCKER_HOST=tcp://localhost:4243 should fix it.

  2. stefanw commented on Feb 10, 2014

    @stefanw
    Author

    Great, this works, thanks!

  3. bfirsh commented on Feb 10, 2014

    @bfirsh

    Bug in docker-py: docker/docker-py#166

  4. gregory commented on Jul 22, 2014

    @gregory
    $ docker version
    Client version: 1.1.1
    Client API version: 1.13
    Go version (client): go1.2.1
    Git commit (client): bd609d2
    Server version: 1.1.1
    Server API version: 1.13
    Go version (server): go1.2.1
    Git commit (server): bd609d2
    
    $ ~/bin/boot2docker status
    running
    $ echo $DOCKER_HOST
    tcp://192.168.59.103:2375
    $ fig --version
    fig 0.5.1
    $ fig up
    Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?
    If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
    

    Anyone experiencing the same issue?

  5. rusllonrails commented on Aug 7, 2014

    @rusllonrails

    @gregory yeah, I got same on:

    Ubuntu 14.04
    Docker version 1.1.2, build d84a070
    Fig 0.5.2
    

    Still not found the way to fix it.
    Added detailed explanation here #73

  6. rusllonrails commented on Aug 8, 2014

    @rusllonrails

    @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

  7. gu-fan commented on Sep 5, 2014

    @gu-fan

    Thanks, Got the same issue, and fixed by this thread

  8. bfirsh commented on Sep 11, 2014

    @bfirsh

    Think it's fixed now. docker/docker-py#259

  9. jaydattdesai commented on Sep 12, 2014

    @jaydattdesai

    @RuslanHamidullin - Thanks for the solution, it works for me even on ubuntu 12.04

  10. rusllonrails commented on Sep 12, 2014

    @rusllonrails
  11. rameshtyaga commented on Dec 10, 2014

    @rameshtyaga

    @RuslanHamidullin your solution works for me as well, Thank you.

    I have

    Ubuntu 14.04
    Docker 1.3.2
    fig 1.0.1
    
  12. rusllonrails commented on Dec 10, 2014

    @rusllonrails

    @trkrameshkumar 🍻

  13. rameshtyaga commented on Dec 10, 2014

    @rameshtyaga

    @RuslanHamidullin but every time i log out or restart my laptop, i have to follow these steps again

    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 
    

    how can we make this configuration permanent.

  14. rameshtyaga commented on Dec 10, 2014

    @rameshtyaga

    i added this line

    export DOCKER_HOST=tcp://localhost:4243
    on .bashrc file now it is loaded very time

  15. 27 remaining items

  16. thaJeztah commented on Sep 5, 2015

    @thaJeztah
    Member

    Good to hear! Just a tip; when customizing systemd options, the best approach is to not modify the default docker.service, but to use "drop-ins"; this section explains how to do that; https://docs.docker.com/articles/systemd/#custom-docker-daemon-options

    I still wonder where the DOCKER_HOST localhost:4234 came from (since you mentioned this was on a fresh install).

    @dnephin is there anything to be done in docker-compose w.r.t not supporting fd://?

  17. Glideh commented on Sep 7, 2015

    @Glideh

    Thank you for the systemd option tip.
    To be clear about localhost:4234, I did set this environment variable because the default http+unix://var/run/docker.sock assumed by docker-compose were not connecting (and I though the daemon were defaulting to localhost:4234).

  18. thaJeztah commented on Sep 7, 2015

    @thaJeztah
    Member

    @Glideh ah, thanks for explaining, yes 4234 was the "old" port, we now have 2375/2376 registered at iana.

  19. Glideh commented on Sep 7, 2015

    @Glideh

    I see, keeping in mind the default was actually fd://

  20. thaJeztah commented on Sep 7, 2015

    @thaJeztah
    Member

    @Glideh yes, perhaps a separate issue should be created for that?

  21. Glideh commented on Sep 7, 2015

    @Glideh

    That's right, let me create one

  22. elouanKeryell-Even commented on Sep 17, 2015

    @elouanKeryell-Even

    I had the following error:

    $ docker-compose up
    Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
    
    If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
    

    Following mucsi96's piece of advice (#88 (comment)), I added myself to the docker group and now docker-compose works fine.

  23. ismailsunni commented on Oct 15, 2015

    @ismailsunni

    @WinstonSureChill glad, had the same problem and the same solution as yours. Thanks

  24. lrkwz commented on Nov 16, 2015

    @lrkwz

    @WinstonSureChill same problem but adding myself to docker group did not solve :-(

    ~/l/l/docker-symfony> groups                                                                                                                                  
        lrkwz adm cdrom sudo dip plugdev lpadmin sambashare wireshark docker
    
  25. Jwpe commented on Nov 16, 2015

    @Jwpe

    @lrkwz I had the same issue - turned out it was due to a corrupted container as described in moby/moby#17688

  26. brunodles commented on Nov 22, 2015

    @brunodles

    The problem is on Your docker instalation. I got the same isue here for awhile.
    Just add your user to docker group, and try to run docker version, you shuld get something like this:

    Client:
     Version:      1.9.1
     API version:  1.21
     Go version:   go1.4.2
     Git commit:   a34a1d5
     Built:        Fri Nov 20 13:20:08 UTC 2015
     OS/Arch:      linux/amd64
    
    Server:
     Version:      1.9.1
     API version:  1.21
     Go version:   go1.4.2
     Git commit:   a34a1d5
     Built:        Fri Nov 20 13:20:08 UTC 2015
     OS/Arch:      linux/amd64
    

    But if you got some instalation issue you won't be able to see server info.
    You can always run with root user sudo docker-compose up.
    I hope that helps.

  27. Mahmoudz commented on May 14, 2016

    @Mahmoudz

    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.

  28. aleogr commented on Jun 14, 2016

    @aleogr

    @rusllonrails thank you mate

  29. added a commit that references this issue on Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions