简体   繁体   English

“您的docker守护程序是否正常运行?”Linux上的docker hello world教程出现问题

[英]“Is your docker daemon up and running?” Problems with docker hello world tutorial on Linux

I am running the installation tutorial for Docker on Linux - Ubuntu 14.04 我在Linux上运行Docker的安装教程--Ubuntu 14.04

Going step by step through the tutorial, I get the following error message: 逐步完成本教程,我收到以下错误消息:

docker run hello-world

Post http:///var/run/docker.sock/v1.20/containers/create: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?

The similar question docker error: /var/run/docker.sock: no such file or directory refers to boot2docker which I am not using 类似的问题docker错误:/var/run/docker.sock:没有这样的文件或目录引用我不使用的boot2docker

Had the same issue, solved: 有同样的问题,解决了:

docker-machine start default
eval "$(docker-machine env default)"

I got the same problem today. 我今天遇到了同样的问题。 you just have to start the service. 你只需要启动服务。

sudo service docker start

It works on linux. 它适用于Linux。 I don't know if it works on mac 我不知道它是否适用于mac

Check the ownership of the file /var/run/docker.sock : 检查文件/var/run/docker.sock的所有权:

ls -l /var/run/docker.sock
srw-rw----. 1 root root 0 Nov 18 16:17 /var/run/docker.sock

Change the group settings to dockerroot : 将组设置更改为dockerroot

sudo chown root:dockerroot /var/run/docker.sock

ls -l /var/run/docker.sock
srw-rw----. 1 root dockerroot 0 Nov 18 16:17 /var/run/docker.sock

Then it should work. 然后它应该工作。

I had the same problem running docker on ubuntu 14.04. 我在ubuntu 14.04上运行docker时遇到了同样的问题。

Trying running Docker as root: sudo docker run hello-world 尝试以root身份运行Docker: sudo docker run hello-world

Type in password when prompted. 提示时输入密码。

Both the solution here are tried and tested on linux only 这里的解决方案都只在linux上试用和测试过
Solution 1: 解决方案1:
I was Having the same issue, Login with root privilege solved my problem 我遇到了同样的问题,使用root权限登录解决了我的问题
Solution 2: 解决方案2:
The solution here works only with root user because root user has full access to linux socket similarly docker group has full access to linux socket. 此解决方案仅适用于root用户,因为root用户具有对linux套接字的完全访问权限,类似docker组具有对linux套接字的完全访问权限。 if you want to run this with non root user you need to add user to docker group, you can do this with following command - 如果你想用非root用户运行它你需要将用户添加到docker组,你可以使用以下命令执行此操作 -

sudo usermod -aG docker $(whoami)

Now logout and login you should be able to work with non-root user :) 现在注销并登录你应该能够与非root用户一起工作:)

After getting stuck I turned off the computer and went on a road trip. 卡住之后,我关掉电脑,然后去公路旅行。 One Monday I turned the computer on and docker run hello-world runs just as the tutorial indicated. 一个星期一我打开电脑, docker run hello-world正如教程所示docker run hello-world运行。

Had exactly the same problem on Windows 8.1 Answer was to open the Oracle VM Virtual Box, right click on the default instance and then click on "Show" icon. 在Windows 8.1上遇到完全相同的问题答案是打开Oracle VM Virtual Box,右键单击默认实例,然后单击“显示”图标。 Then saw BootLocker logo. 然后看了BootLocker标志。 Then back to the Docker Quickstarter "> whale" icon, double click and ascii docker appears. 然后回到Docker Quickstarter“> whale”图标,双击并出现ascii docker。

In linux, after installation, though docker version was giving a proper output, docker run hello-world was not working because the service was not up. 在linux中,安装后,尽管docker version提供了正确的输出,但是docker run hello-world无法正常工作,因为服务没有启动。

I tried service docker restart in SLES 12 SP3 Linux machine. 我在SLES 12 SP3 Linux机器上尝试过service docker restart It worked. 有效。 So probably your docker daemon needs a restart. 所以你的docker守护进程可能需要重启。

Try the same command service docker restart and it should work. 尝试相同的命令service docker restart ,它应该工作。

So, is the Docker daemon running? 那么,Docker守护进程是否正在运行? What troubleshooting did you already do? 你已经做了什么故障排除?

The tutorial doesn't mention starting Docker or adding yourself to the docker group so that you can run Docker command without sudo (although, this should have been mentioned when you installed Docker). 本教程没有提到启动Docker或将自己添加到docker组,以便您可以在没有sudo情况下运行Docker命令(尽管在安装Docker时应该已经提到过)。 You need to do both of these things first. 你需要先做这两件事。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM