码迷,mamicode.com
首页 > 其他好文 > 详细

Centos 7 之 Docker 安装及相关命令

时间:2017-10-19 21:04:40      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:current   rem   remove   start   loaded   strong   comm   container   命令   

1、查看是否已经安装过docker

[root@localhost ~]# yum list installed | grep docker

docker.x86_64                        2:1.12.6-55.gitc4618fb.el7.centos @extras 
docker-client.x86_64                 2:1.12.6-55.gitc4618fb.el7.centos @extras 
docker-common.x86_64                 2:1.12.6-55.gitc4618fb.el7.centos @extras 

2、以上表示已经安装,删除docker

[root@localhost ~]# yum remove –y docker.x86_64

[root@localhost ~]# yum remove –y docker-client.x86_64

[root@localhost ~]# yum remove –y docker-common.x86_64

3、安装docker(-y 表示静默安装,安装过程不再询问)

[root@localhost ~]# yum install -y docker

4、启动docker

[root@localhost ~]# systemctl start docker.service

5、查看当前docker状态
[root@localhost ~]# systemctl status docker      

● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since 四 2017-10-19 19:37:56 CST; 6s ago
     Docs: http://docs.docker.com
Main PID: 2896 (dockerd-current)
   CGroup: /system.slice/docker.service
           ├─2896 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/lib...
           └─2900 /usr/bin/docker-containerd-current -l unix:///var/run/docke...

10月 19 19:37:55 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:55 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:55 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:55 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:55 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:56 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:56 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:56 localhost.localdomain dockerd-current[2896]: time="2017-10-...
10月 19 19:37:56 localhost.localdomain systemd[1]: Started Docker Applicatio...
10月 19 19:37:56 localhost.localdomain dockerd-current[2896]: time="2017-10-...
Hint: Some lines were ellipsized, use -l to show in full.

6、列出本地所有镜像

[root@localhost ~]# docker images

7、停止docker

[root@localhost ~]# systemctl stop docker

Centos 7 之 Docker 安装及相关命令

标签:current   rem   remove   start   loaded   strong   comm   container   命令   

原文地址:http://www.cnblogs.com/justlove/p/7694651.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!