Can't connect to docker from docker-compose

前端 未结 24 2060
说谎
说谎 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:51

    Answer from @srfrnk works for me.

    In my situation, I had the next docker-compose.yml file:

      nginx:
        build:
          context: ./
          dockerfile: "./docker/nginx.staging/Dockerfile"
        depends_on:
          - scripts
        environment:
          NGINX_SERVER_NAME: "some.host"
          NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
          NGINX_ERROR_LOG_LEVEL: debug
          NGINX_BACKEND_HOST: scripts
          NGINX_SERVER_ROOT: /var/www/html
        volumes:
          - ./docker-runtime/drupal/files:/var/www/html/sites/default/files:rw
        ports:
          - 80:80
    

    ./docker-runtime owner and group - is root when the other files owner - my user. When I tried to build nginx

    Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
    

    I added ./docker-runtime to .dockerignore and it is solved my problem.

提交回复
热议问题