docker error: /var/run/docker.sock: no such file or directory

后端 未结 11 985
轻奢々
轻奢々 2020-12-07 14:52

I am new to docker. I have a shell script that loads data into impala and I want a docker file that runs builds an image and run the container. I am on mac, installed boot2d

相关标签:
11条回答
  • 2020-12-07 15:18

    I also got this error. Though, I did not use boot2docker but just installed "plain" docker on Ubuntu (see https://docs.docker.com/installation/ubuntulinux/).

    I got the error ("dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?") because the docker daemon was not running, yet.

    On Ubuntu, you need to start the service:

    sudo service docker start
    

    See also http://blog.arungupta.me/resolve-dial-unix-docker-sock-error-techtip64

    0 讨论(0)
  • 2020-12-07 15:20

    You can quickly setup your environment using shellinit

    At your command prompt execute:

    $(boot2docker shellinit)  
    

    That will populate and export the environment variables and initialize other features.

    0 讨论(0)
  • 2020-12-07 15:20

    On my MAC when I start boot2docker-vm on the terminal using

    
    boot2docker start
    

    I see the following

    
    To connect the Docker client to the Docker daemon, please set:
        export DOCKER_CERT_PATH=
        export DOCKER_TLS_VERIFY=1
        export DOCKER_HOST=tcp://:2376
    

    After setting these environment variables I was able to run the build without the problem.

    Update [2016-04-28] If you are using a the recent versions of docker you can do

    eval $(docker-machine env) will set the environment

    (docker-machine env will print the export statements)

    0 讨论(0)
  • 2020-12-07 15:23

    docker pull will fail if docker service is not running. Make sure it is running by

    :~$ ps aux | grep docker
    root     18745  1.7  0.9 284104 13976 ?   Ssl  21:19   0:01 /usr/bin/docker -d
    

    If it is not running, you can start it by

    sudo service docker start

    For Ubuntu 15 and above use

    sudo systemctl start docker

    0 讨论(0)
  • 2020-12-07 15:29

    In Linux, first of all execute sudo service docker start in terminal.

    0 讨论(0)
  • 2020-12-07 15:33

    For boot2docker on Windows, after seeing:

    FATA[0000] Get http:///var/run/docker.sock/v1.18/version: 
    dial unix /var/run/docker.sock: no such file or directory.  
    Are you trying to connect to a TLS-enabled daemon without TLS?
    

    All I did was:

    boot2docker start
    boot2docker shellinit
    

    That generated:

    export DOCKER_CERT_PATH=C:\Users\vonc\.boot2docker\certs\boot2docker-vm
    export DOCKER_TLS_VERIFY=1
    export DOCKER_HOST=tcp://192.168.59.103:2376
    

    Finally:

    boot2docker ssh
    

    And docker works again

    0 讨论(0)
提交回复
热议问题