Skip to content

docker-compose could not connect to docker daemon on windows 10 #3901

Closed

Description

I am install docker for windows from https://download.docker.com/win/stable/InstallDocker.msi

I can run docker command , but docker-compose does not working.

PS D:\workspace\netroby\kt-client> docker-compose up
ERROR: Couldn't connect to Docker daemon. You might need to install Docker:

https://docs.docker.com/engine/installation/
PS D:\workspace\netroby\kt-client> docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
PS D:\workspace\netroby\kt-client> docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
netroby/docker-kt-client   latest              1902c4e6f453        29 minutes ago      702 MB
PS D:\workspace\netroby\kt-client> docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 1.12.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 8
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host bridge null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.15-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952 GiB
Name: moby
ID: AY6G:MWXP:XKEZ:2MJX:SASZ:LUAH:QM65:P3XI:4QHX:2Q6D:I3F3:2EOD
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

Activity

  1. PatrickLang commented on Sep 2, 2016

    @PatrickLang

    Ping @friism

  2. friism commented on Sep 2, 2016

    @friism

    @netroby what's your docker-compose --version?

  3. shin- commented on Sep 2, 2016

    @shin-

    Hi @netroby ,

    Do you have a DOCKER_HOST environment variable defined? If yes, what's the value for that variable? If not, could you try setting it with the following value: npipe:////./pipe/docker_engine?

  4. PatrickLang commented on Sep 6, 2016

    @PatrickLang

    @shin- I tried two forms of that, no luck. I'm also on docker-compose version 1.8.0, build d988a55

    $ENV:DOCKER_HOST="npipe://\\.\pipe\docker_engine"
    docker-compose up -d
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "compose\cli\main.py", line 61, in main
      File "compose\cli\main.py", line 113, in perform_command
      File "compose\cli\main.py", line 835, in up
      File "compose\project.py", line 372, in up
      File "compose\project.py", line 539, in warn_for_swarm_mode
      File "site-packages\docker\api\daemon.py", line 33, in info
      File "site-packages\docker\utils\decorators.py", line 47, in inner
      File "site-packages\docker\client.py", line 140, in _get
      File "site-packages\requests\sessions.py", line 477, in get
      File "site-packages\requests\sessions.py", line 465, in request
      File "site-packages\requests\sessions.py", line 573, in send
      File "site-packages\requests\adapters.py", line 370, in send
      File "site-packages\requests\packages\urllib3\connectionpool.py", line 544, in urlopen
      File "site-packages\requests\packages\urllib3\connectionpool.py", line 374, in _make_request
      File "httplib.py", line 1133, in getresponse
      File "httplib.py", line 390, in __init__
      File "site-packages\docker\transport\npipesocket.py", line 99, in makefile
    ValueError: buffer size must be strictly positive
    docker-compose returned -1
    
    $ENV:DOCKER_HOST="npipe:////./pipe/docker_engine"
    docker-compose up -d
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "compose\cli\main.py", line 61, in main
      File "compose\cli\main.py", line 113, in perform_command
      File "compose\cli\main.py", line 835, in up
      File "compose\project.py", line 372, in up
      File "compose\project.py", line 539, in warn_for_swarm_mode
      File "site-packages\docker\api\daemon.py", line 33, in info
      File "site-packages\docker\utils\decorators.py", line 47, in inner
      File "site-packages\docker\client.py", line 140, in _get
      File "site-packages\requests\sessions.py", line 477, in get
      File "site-packages\requests\sessions.py", line 465, in request
      File "site-packages\requests\sessions.py", line 573, in send
      File "site-packages\requests\adapters.py", line 370, in send
      File "site-packages\requests\packages\urllib3\connectionpool.py", line 544, in urlopen
      File "site-packages\requests\packages\urllib3\connectionpool.py", line 374, in _make_request
      File "httplib.py", line 1133, in getresponse
      File "httplib.py", line 390, in __init__
      File "site-packages\docker\transport\npipesocket.py", line 99, in makefile
    ValueError: buffer size must be strictly positive
    docker-compose returned -1
    
  5. PatrickLang commented on Sep 6, 2016

    @PatrickLang

    If I configure the insecure port, docker-compose works:

    $ENV:DOCKER_HOST="127.0.0.1:2375"
    docker-compose up -d
    
  6. shin- commented on Sep 8, 2016

    @shin-

    Thanks @PatrickLang ,

    I created docker/docker-py#1188 to track the resolution of that npipe issue.

  7. added this to the 1.8.1 milestone on Sep 8, 2016
  8. alexellis commented on Sep 30, 2016

    @alexellis

    I'm having exactly the same issue - I've tried the named pipe, too. Fully updated Windows 10 - Compose 1.8.1 etc. I can run containers though.

  9. shin- commented on Sep 30, 2016

    @shin-

    @alexellis Did you set $DOCKER_HOST to the npipe address? What error do you see? Please share the full logs using --verbose.

  10. khaale commented on Oct 9, 2016

    @khaale

    Hi, have the same issue on a docker-compose version 1.9.0dev, build 9248298.

    docker-compose.exe --verbose up
    compose.config.config.find: Using configuration files: .\docker-compose.yml
    docker.auth.auth.find_config_file: Trying paths: ['C:\Users\Aleksander.docker\config.json', 'C:\Users\Aleksander
    .dockercfg']
    docker.auth.auth.find_config_file: No config file found
    Traceback (most recent call last):
    File "", line 3, in
    File "compose\cli\main.py", line 62, in main
    File "compose\cli\main.py", line 111, in perform_command
    File "compose\cli\command.py", line 36, in project_from_options
    File "compose\cli\command.py", line 111, in get_project
    File "compose\cli\command.py", line 86, in get_client
    File "site-packages\docker\api\daemon.py", line 76, in version
    File "site-packages\docker\utils\decorators.py", line 47, in inner
    File "site-packages\docker\client.py", line 139, in _get
    File "site-packages\requests\sessions.py", line 477, in get
    File "site-packages\requests\sessions.py", line 465, in request
    File "site-packages\requests\sessions.py", line 573, in send
    File "site-packages\requests\adapters.py", line 370, in send
    File "site-packages\requests\packages\urllib3\connectionpool.py", line 544, in urlopen
    File "site-packages\requests\packages\urllib3\connectionpool.py", line 374, in _make_request
    File "httplib.py", line 1129, in getresponse
    File "httplib.py", line 390, in init
    File "site-packages\docker\transport\npipesocket.py", line 99, in makefile
    ValueError: buffer size must be strictly positive
    docker-compose returned -1

    Also tried with:

    • $env:DOCKER_HOST="npipe:////./pipe/docker_engine" - as suggested above - the same error
    • $env:DOCKER_HOST="npipe:////./pipe/docker_engine_windows" - the address I have found in a Docker's log: [WindowsDockerDaemon][Info ] time="2016-10-10T00:12:53.317784100+04:00" level=info msg="API listen on //./pipe/docker_engine_windows" - the same error
    • $env:DOCKER_HOST="127.0.0.1:2375" - eliminates this error,
  11. ravindravv commented on Oct 14, 2016

    @ravindravv

    Getting error while doing docker-compose on my windows 2016( Evaluation edition) system.

    PS C:\MusicStore> docker-compose -f .\docker-compose.windows.yml build
    db uses an image, skipping
    Building web
    Traceback (most recent call last):
    File "", line 3, in
    File "compose\cli\main.py", line 62, in main
    File "compose\cli\main.py", line 114, in perform_command
    File "compose\cli\main.py", line 220, in build
    File "compose\project.py", line 300, in build
    File "compose\service.py", line 735, in build
    File "site-packages\docker\api\build.py", line 105, in build
    File "site-packages\docker\utils\decorators.py", line 47, in inner
    File "site-packages\docker\client.py", line 135, in _post
    File "site-packages\requests\sessions.py", line 508, in post
    File "site-packages\requests\sessions.py", line 465, in request
    File "site-packages\requests\sessions.py", line 573, in send
    File "site-packages\requests\adapters.py", line 370, in send
    File "site-packages\requests\packages\urllib3\connectionpool.py", line 544, in urlopen
    File "site-packages\requests\packages\urllib3\connectionpool.py", line 374, in _make_request
    File "httplib.py", line 1133, in getresponse
    File "httplib.py", line 390, in init
    File "site-packages\docker\transport\npipesocket.py", line 99, in makefile
    ValueError: buffer size must be strictly positive
    docker-compose returned -1

    MY DOCKER INFO

    PS C:\Users\Administrator> docker info
    Containers: 0
    Running: 0
    Paused: 0
    Stopped: 0
    Images: 5
    Server Version: 1.12.2-cs2-ws-beta
    Storage Driver: windowsfilter
    Windows:
    Logging Driver: json-file
    Plugins:
    Volume: local
    Network: nat null overlay
    Swarm: inactive
    Default Isolation: process
    Kernel Version: 10.0 14393 (14393.321.amd64fre.rs1_release_inmarket.161004-2338)
    Operating System: Windows Server 2016 Standard Evaluation
    OSType: windows
    Architecture: x86_64
    CPUs: 2
    Total Memory: 1.747 GiB
    Name: WINDOCKERS
    ID: SVSS:23T3:AEMM:RN5J:MUZG:DY6I:XV5T:BL36:AWDK:FSVZ:UIEI:UREX
    Docker Root Dir: C:\ProgramData\docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    Insecure Registries:
    127.0.0.0/8
    Live Restore Enabled: false
    PS C:\Users\Administrator> docker version
    Client:
    Version: 1.12.2-cs2-ws-beta
    API version: 1.25
    Go version: go1.7.1
    Git commit: 050b611
    Built: Tue Oct 11 02:35:40 2016
    OS/Arch: windows/amd64

    Server:
    Version: 1.12.2-cs2-ws-beta
    API version: 1.25
    Go version: go1.7.1
    Git commit: 050b611
    Built: Tue Oct 11 02:35:40 2016
    OS/Arch: windows/amd64

  12. rs38 commented on Oct 15, 2016

    @rs38

    why is this closed, the error is still present in latest builds, see also #1188

  13. Iliyan-Iliev commented on Oct 17, 2016

    @Iliyan-Iliev

    I had the same issue as Ravindravv. I am using a VM with Windows Server 2016 Evaluation and the VM is isntalled on ESXi 6 host and here are the steps that I executed to resolve the issue. They are describe in the beginning of the article - https://blog.docker.com/2016/09/build-your-first-docker-windows-server-container/:
    netsh advfirewall firewall add rule name="docker engine" dir=in action=allow protocol=TCP localport=2375
    dockerd --unregister-service
    dockerd -H npipe:// -H 0.0.0.0:2375 --register-service
    Start-Service docker

    The key moment is in the last command:
    $env:DOCKER_HOST = ":2375"
    I provided the localhost
    $env:DOCKER_HOST = "127.0.0.1:2375"
    And after that everything was running fine.

  14. shin- commented on Oct 17, 2016

    @shin-

    @ravindravv @rs38 @Iliyan-Iliev - Please see #4030 for additional fixes for Windows platforms.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions