Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

[root@hadoop101 ~]# docker images
执行后发现报错如下:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
按如下操作解决了这个问题:

[root@hadoop101 ~]# systemctl daemon-reload 
[root@hadoop101 ~]# sudo service docker restart
Redirecting to /bin/systemctl restart  docker.service
[root@hadoop101 ~]# sudo service docker status
[root@hadoop101 ~]# sudo docker run hello-world
[root@hadoop101 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              fce289e99eb9        8 months ago        1.84kB
training/webapp     latest              6fae60ef3446        4 years ago         349MB

REPOSITORY :表示镜像的仓库源
TAG :镜像的标签
IMAGE ID :镜像ID
CREATED:镜像创建时间
SIZE:镜像大小

[root@hadoop101 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
centos              latest              67fa590cfc1c        4 weeks ago         202MB
centos              7.2.1511            9aec5c5fe4ba        6 months ago        195MB
hello-world         latest              fce289e99eb9        8 months ago        1.84kB
training/webapp     latest              6fae60ef3446        4 years ago         349MB

同一仓库源可以有多个TAG,代表这个仓库源的不同版本,我们使用REPOSITORY :TAG来定义不同的镜像。
如果你不指定一个镜像的版本标签,例如你只用centos,docker将默认使用centos:latest镜像。

[root@hadoop101 ~]# docker images -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
centos              latest              67fa590cfc1c        4 weeks ago         202MB
centos              7.2.1511            9aec5c5fe4ba        6 months ago        195MB
hello-world         latest              fce289e99eb9        8 months ago        1.84kB
training/webapp     latest              6fae60ef3446        4 years ago         349MB
[root@hadoop101 ~]# docker images -q
6
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值