Centos 7 之 Docker 安装及相关命令
Posted 风华长情
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos 7 之 Docker 安装及相关命令相关的知识,希望对你有一定的参考价值。
1、查看是否已经安装过docker
[[email protected] ~]# 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
[[email protected] ~]# yum remove –y docker.x86_64
[[email protected] ~]# yum remove –y docker-client.x86_64
[[email protected] ~]# yum remove –y docker-common.x86_64
3、安装docker(-y 表示静默安装,安装过程不再询问)
[[email protected] ~]# yum install -y docker
4、启动docker
[[email protected] ~]# systemctl start docker.service
5、查看当前docker状态
[[email protected] ~]# 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、列出本地所有镜像
[[email protected] ~]# docker images
7、停止docker
[[email protected] ~]# systemctl stop docker
以上是关于Centos 7 之 Docker 安装及相关命令的主要内容,如果未能解决你的问题,请参考以下文章