简体   繁体   English

FATA [0000]获取http:///var/run/docker.sock/v1.17/version:拨打unix /var/run/docker.sock

[英]FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock

I install docker using this guide . 我使用本指南安装docker。 I'm using 我正在使用

Distributor ID: Ubuntu
Description:    Ubuntu 13.10
Release:    13.10
Codename:   saucy

Even though I excetly followed the steps given I get below error when I issue docker version command. 即使我完全按照给出的步骤操作,当我发出docker version命令时也遇到了以下错误。

Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

I aleardy referred below, but it does not work for me. 我在下面提到了aleardy,但这对我不起作用。 Most of the them focus on Mac OS X 其中大多数关注Mac OS X

Installing a web application in a Docker container: dial unix /var/run/docker.sock: no such file or directory 在Docker容器中安装Web应用程序:拨打unix /var/run/docker.sock:无此类文件或目录

docker error: /var/run/docker.sock: no such file or directory 码头工人错误:/var/run/docker.sock:没有这样的文件或目录

Am I trying to connect to a TLS-enabled daemon without TLS? 我是否要连接到没有TLS的启用TLS的守护程序?

How can I fix this? 我怎样才能解决这个问题?

Please see the O/P below 请参见下面的O / P

INFO[0000] +job serveapi(unix:///var/run/docker.sock)   
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 
DEBU[0000] Registering POST, /containers/{name:.*}/resize 
DEBU[0000] Registering POST, /containers/create         
DEBU[0000] Registering POST, /containers/{name:.*}/kill 
DEBU[0000] Registering POST, /containers/{name:.*}/start 
DEBU[0000] Registering POST, /containers/{name:.*}/stop 
DEBU[0000] Registering POST, /containers/{name:.*}/copy 
DEBU[0000] Registering POST, /containers/{name:.*}/exec 
DEBU[0000] Registering POST, /exec/{name:.*}/start      
DEBU[0000] Registering POST, /auth                      
DEBU[0000] Registering POST, /build                     
DEBU[0000] Registering POST, /containers/{name:.*}/wait 
DEBU[0000] Registering POST, /containers/{name:.*}/attach 
DEBU[0000] Registering POST, /images/{name:.*}/tag      
DEBU[0000] Registering POST, /containers/{name:.*}/pause 
DEBU[0000] Registering POST, /containers/{name:.*}/rename 
DEBU[0000] Registering POST, /commit                    
DEBU[0000] Registering POST, /images/create             
DEBU[0000] Registering POST, /images/load               
DEBU[0000] Registering POST, /images/{name:.*}/push     
DEBU[0000] Registering POST, /containers/{name:.*}/unpause 
DEBU[0000] Registering POST, /containers/{name:.*}/restart 
DEBU[0000] Registering POST, /exec/{name:.*}/resize     
DEBU[0000] Registering DELETE, /containers/{name:.*}    
DEBU[0000] Registering DELETE, /images/{name:.*}        
DEBU[0000] Registering OPTIONS,                         
DEBU[0000] Registering GET, /containers/{name:.*}/json  
DEBU[0000] Registering GET, /events                     
DEBU[0000] Registering GET, /images/search              
DEBU[0000] Registering GET, /images/get                 
DEBU[0000] Registering GET, /images/{name:.*}/get       
DEBU[0000] Registering GET, /images/{name:.*}/history   
DEBU[0000] Registering GET, /containers/json            
DEBU[0000] Registering GET, /containers/{name:.*}/export 
DEBU[0000] Registering GET, /info                       
DEBU[0000] Registering GET, /images/viz                 
DEBU[0000] Registering GET, /containers/{name:.*}/top   
DEBU[0000] Registering GET, /containers/{name:.*}/logs  
DEBU[0000] Registering GET, /containers/{name:.*}/stats 
DEBU[0000] Registering GET, /exec/{id:.*}/json          
DEBU[0000] Registering GET, /_ping                      
DEBU[0000] Registering GET, /images/json                
DEBU[0000] Registering GET, /images/{name:.*}/json      
DEBU[0000] Registering GET, /containers/{name:.*}/attach/ws 
DEBU[0000] Registering GET, /version                    
DEBU[0000] Registering GET, /containers/ps              
DEBU[0000] Registering GET, /containers/{name:.*}/changes 
DEBU[0000] docker group found. gid: 999                 
DEBU[0000] Using graph driver aufs                      
DEBU[0000] Migrating existing containers                
DEBU[0000] Creating images graph                        
DEBU[0000] Restored 0 elements                          
DEBU[0000] Creating repository list                     
INFO[0000] +job init_networkdriver()                    
DEBU[0000] /sbin/iptables, [--wait -C POSTROUTING -t nat -s 172.17.42.1/16 ! -o docker0 -j MASQUERADE] 
DEBU[0000] /sbin/iptables, [--wait -D FORWARD -i docker0 -o docker0 -j DROP] 
DEBU[0000] /sbin/iptables, [--wait -C FORWARD -i docker0 -o docker0 -j ACCEPT] 
DEBU[0000] /sbin/iptables, [--wait -C FORWARD -i docker0 ! -o docker0 -j ACCEPT] 
DEBU[0000] /sbin/iptables, [--wait -C FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT] 
DEBU[0000] /sbin/iptables, [--wait -t nat -D PREROUTING -m addrtype --dst-type LOCAL -j DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -t nat -D OUTPUT -m addrtype --dst-type LOCAL ! --dst 127.0.0.0/8 -j DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -t nat -D OUTPUT -m addrtype --dst-type LOCAL -j DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -t nat -D PREROUTING -j DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -t nat -D OUTPUT -j DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -t nat -F DOCKER]    
DEBU[0000] /sbin/iptables, [--wait -t nat -X DOCKER]    
DEBU[0000] /sbin/iptables, [--wait -t nat -n -L DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -t nat -N DOCKER]    
DEBU[0000] /sbin/iptables, [--wait -C -m addrtype --dst-type LOCAL] 
DEBU[0000] /sbin/iptables, [--wait -t nat -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -C -m addrtype --dst-type LOCAL ! --dst 127.0.0.0/8] 
DEBU[0000] /sbin/iptables, [--wait -t nat -A OUTPUT -m addrtype --dst-type LOCAL ! --dst 127.0.0.0/8 -j DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -t filter -n -L DOCKER] 
DEBU[0000] /sbin/iptables, [--wait -C FORWARD -o docker0 -j DOCKER] 
INFO[0000] -job init_networkdriver() = OK (0)           
INFO[0000] WARNING: Your kernel does not support cgroup swap limit. 
DEBU[0000] Restarting containers...                     
INFO[0000] docker daemon: 1.5.0 a8a31ef; execdriver: native-0.2; graphdriver: aufs 
INFO[0000] +job acceptconnections()                     
INFO[0000] -job acceptconnections() = OK (0)            
DEBU[0022] Calling GET /version                         
INFO[0022] GET /v1.17/version                           
INFO[0022] +job version()                               
INFO[0022] -job version() = OK (0)

我在Ubuntu 14.04(3.13.0-39-generic)上遇到了类似的问题解决方案是:

sudo apt-get install apparmor

service docker restart

The problem is that your user has not been added to the docker group. 问题是您的用户尚未添加到docker组。

Try: 尝试:

sudo usermod -a -G docker <uname>

If you don't want to log in/out from your current shell, run: 如果您不想从当前的shell登录/注销,请运行:

newgrp docker

This error is because you have not started the docker service. 该错误是因为您尚未启动docker服务。 Once you start the service it creates /var/run/docker.sock and then the error is resolved. 启动服务后,它将创建/var/run/docker.sock ,然后解决该错误。

sudo service docker start

Then you can see if the installation is proper or not by sudo docker info . 然后您可以通过sudo docker info查看安装是否正确。

I have Ubuntu 14.04,3.16.0-33-generic. 我有Ubuntu 14.04,3.16.0-33-generic。 These steps worked for me: 这些步骤对我有用:

1) Install docker 1)安装码头工人

wget -qO- https://get.docker.com/ | wget -qO- https://get.docker.com/ | sh SH

2) Add your user to docker group: 2)将您的用户添加到docker组:

sudo usermod -aG docker "username" sudo usermod -aG泊坞窗“用户名”

3) Reboot. 3)重新启动。 I don't know if there is a simple way to avoid reboot. 我不知道是否有避免重启的简单方法。

Before rebooting, nothing of this post nor others worked for me 重新启动前,这篇文章或其他文章对我没有任何帮助

1) create a docker group 1)创建一个docker

sudo groupadd docker

2) add <enter_username> to the created docker group 2)添加<enter_username>到所创建的docker

sudo usermod -aG docker <enter_username>

3) reboot the system 3)重启系统

sudo reboot

4) verify whether running the command using sudo is not required anymore 4)验证是否不再需要使用sudo运行命令

Executing: docker run hello-world should result in: 执行: docker run hello-world应该导致:

[user@host ~]$ docker run hello-world

Hello from Docker.
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
 https://hub.docker.com

For more examples and ideas, visit:
 https://docs.docker.com/userguide/

Reference 参考

Create a docker group 创建一个码头工人组

在此处输入图片说明

When you first install you'll need to use sudo as docker needs to bind to a Unix socket which is owned by root: 首次安装时,您将需要使用sudo,因为docker需要绑定到root拥有的Unix套接字:

sudo docker version

if you still get an error, check the service is running: 如果仍然出现错误,请检查服务是否正在运行:

sudo service docker start

If you want to avoid using sudo try creating and adding yourself to a docker group. 如果要避免使用sudo,请尝试创建自己并将其添加到docker组。

sudo usermod -a -G docker <username>

To activate this change either do, newgrp docker , logout/login or restart your machine. 要激活此更改,请执行newgrp docker ,注销/登录或重新启动计算机。 If using newgrp docker , you might need to also restart the docker daemon. 如果使用newgrp docker ,则可能还需要重新启动docker守护程序。 ( sudo service docker restart ) (Note though that the docker group is equivalent to root...) sudo service docker restart )(请注意,尽管docker组等效于root ...)

(AppArmor my work as it restricts all application access, I have no idea how it would effect Docker) (我的工作是AppArmor,因为它限制了所有应用程序访问,我不知道它将如何影响Docker)

Docker manual is helpful. Docker 手册很有帮助。 Sometimes. 有时。

On OS X, boot2docker up outputs: 在OS X上, boot2docker up输出:

To connect the Docker client to the Docker daemon, please set: export DOCKER_CERT_PATH=/Users/thsoft/.boot2docker/certs/boot2docker-vm export DOCKER_TLS_VERIFY=1 export DOCKER_HOST=tcp://192.168.59.103:2376

Executing these commands solved the problem for me. 执行这些命令为我解决了问题。

On Fedora 21 I had the same issue. 在Fedora 21上,我遇到了同样的问题。 I had installed as sudo su . 我已经安装为sudo su After I ran service docker restart all was well. 在我运行service docker restart之后,一切正常。

I got an error with docker and @mrother's answer really works. 我在docker上遇到错误,@ mrother的答案确实有效。 May be the problem is different, so I just put this for someone's information. 可能是问题有所不同,所以我仅将此信息供他人参考。 I am new here and cannot add comment or vote, so I have to add an answer. 我是新来的,无法添加评论或投票,因此我必须添加答案。 The problem is as follows: 问题如下:

$ docker info $码头工人信息

$ FATA[0000] Get http:///var/run/docker.sock/v1.18/info : dial unix /var/run/docker.sock: no such file or directory. $ FATA [0000]获取http:///var/run/docker.sock/v1.18/info :拨unix /var/run/docker.sock:无此类文件或目录。 Are you trying to connect to a TLS-enabled daemon without TLS? 您是否要连接到没有TLS的启用TLS的守护程序?

So I checked docker daemon with ps aux|grep docker and found none. 所以我用ps aux|grep docker检查了docker守护进程,却没有找到。

So I run docker -d mannully and got this: 所以我运行docker docker -d mannully并得到了这个:

FATA[0000] Shutting down daemon due to errors: Error loading docker apparmor profile: exit status 1 (Feature buffer full.) FATA [0000]由于错误而关闭守护程序:加载docker apparmor配置文件时出错:退出状态1(功能缓冲区已满。)

then sudo apt-get install apparmor fixed this problem. 然后sudo apt-get install apparmor修复了此问题。

请遵循以下解决方案:

sudo chmod -R 777 docker.sock

在Mac 10.9.5上,什么可以帮助我运行:

eval "$(boot2docker shellinit)"
  1. Stop docker daemon 停止docker daemon
  2. sudo rm /var/lib/docker/network/files/local-kv.db 须藤rm /var/lib/docker/network/files/local-kv.db
  3. Start docker daemon 启动docker daemon

Read more: https://github.com/docker/docker/issues/17846 了解更多: https : //github.com/docker/docker/issues/17846

I had this on ubuntu 14.04: FATA[0000] Post http:///var/run/docker.sock/v1.18/containers/create : dial unix /var/run/docker.sock: permission denied. 我在ubuntu 14.04上有此文件:FATA [0000]发表http:///var/run/docker.sock/v1.18/containers/create :拨unix /var/run/docker.sock:权限被拒绝。 Are you trying to connect to a TLS-enabled daemon without TLS? 您是否要连接到没有TLS的启用TLS的守护程序?

I tried: 我试过了:

  1. sudo usermod -a -G docker yourusername sudo usermod -a -G docker yourusername
  2. restart shell 重新启动外壳

This worked for me. 这对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 docker for windows 等效于“-v /var/run/docker.sock:/var/run/docker.sock” - docker for windows equivalent for “-v /var/run/docker.sock:/var/run/docker.sock” 通过将 /var/run/docker.sock 作为卷安装到 docker 容器,我可以做些什么? - What are the things I can do by mounting /var/run/docker.sock as a volume to a docker container? "docker.sock 权限被拒绝" - docker.sock permission denied 从容器内部访问docker.sock - Access docker.sock from inside a container 无法连接到位于 unix:/var/run/docker.sock 的 Docker 守护程序。 docker 守护程序是否正在运行? - Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running? Docker无法通过套接字&#39;/var/run/mysqld/mysqld.sock&#39;连接到本地MySQL服务器(2)Ubuntu - Docker Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Ubuntu 从安装了`docker.sock`的docker容器内查找主机上的开放端口 - Find open ports on host from inside a docker container with `docker.sock` mounted 存在docker.sock且在docker容器中运行权限时无法连接到docker.sock - Unable to connect to docker.sock when it exist with permissions running inside docker container NGINX: connect() to unix:/var/run/php7.0-fpm.sock failed (2: No such file or directory) - NGINX: connect() to unix:/var/run/php7.0-fpm.sock failed (2: No such file or directory) Connect() 到 unix:/var/run/php-fpm.sock 连接到上游时失败(11:资源暂时不可用),客户端:unix:,服务器 - Connect() to unix:/var/run/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: unix:, server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM