[英]docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I installed Docker CE from the official docker site on Ubuntu server 16.04.4 LTS, Release: 16.04, Codename: xenial. 我从Ubuntu服务器16.04.4 LTS上的官方docker站点安装了Docker CE,版本:16.04,Codename:xenial。 I can not find the
/var/lib/docker
file even after I install docker on my machine. 即使在我的机器上安装docker之后,我也找不到
/var/lib/docker
文件。 When I try to run an Ubuntu container for example with: 当我尝试运行Ubuntu容器时,例如:
docker run -it ubuntu
an error message: 错误消息:
docker: Can not connect to the Docker daemon at unix: ///var/run/docker.sock
Is the docker daemon running? docker守护程序是否正在运行?
First you have to ckeck if the docker service is running service docker status
首先,如果docker服务正在运行
service docker status
你必须ckeck
if it's not running, start it: service docker start
如果它没有运行,启动它:
service docker start
then you can use docker run ....
然后你可以使用
docker run ....
请尝试使用sudo: sudo docker run -it ubuntu
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.