Can't connect to docker from docker-compose

前端 未结 24 2059
说谎
说谎 2020-12-07 10:14

I installed docker-machine 0.1.0 and docker-compose 1.1.0 on Mac OS 10.8.5.
Docker-machine is running normally and able to connect by docker-machine ssh.



        
24条回答
  •  死守一世寂寞
    2020-12-07 10:54

    I've had the same symptoms.

    Only diff that it happened only during docker-compose build docker ps worked. Happened with version 2.x as well as 3.x. Restarted docker service, then the machine... Even re-installed docker + docker-compose.

    Tried everything but nothing helped.

    Finally I tried building the Dockerfile "manually" by using docker build.

    Apparently I had a permission issue on a file/folder inside the Docker context. It was trying to read the context when starting the build and failed with a proper error message. However this error message did not propagate to docker-compose which only shows Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?

    Having found that the solution was simply adding the file/folder to the .dockerignore file since it wasn't needed for the build. Another solution might have been to chown or chmod it.

    Anyway maybe this could help someone coming across the same issue that really has nothing to do with docker and the misleading error message being displayed.

提交回复
热议问题