**下载仓库**
cd /etc/yum.repos.d/
wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
**安装稳定版本**
yum list docker-ce --showduplicates | sort -r
yum install docker-ce-19.03.9 docker-ce-cli-19.03.9 containerd.io -y
**启动**
systemctl start docker
systemctl enable docker
systemctl status docker
**版本查看**
docker info
docker version
该步骤是可选的,更改配置需要重启Docker
mkdir -p /etc/docker && touch /etc/docker/daemon.json
cat /etc/docker/daemon.json
{
"registry-mirrors": [
"https://jxf8rbc5.mirror.aliyuncs.com"
],
"data-root": "/data0/docker-home"
}
[root@10-222-32-10 /etc/yum.repos.d]# yum list docker-ce --showduplicates | sort -r
docker-ce.x86_64 3:20.10.9-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.8-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.7-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.6-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.5-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.3-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.2-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.12-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.11-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.10-3.el7 docker-ce-stable
docker-ce.x86_64 3:20.10.0-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.9-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.8-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.7-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.6-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.5-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.3-3.el7 docker-ce-stable
...
==========================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================
Installing:
containerd.io x86_64 1.4.12-3.1.el7 docker-ce-stable 28 M
docker-ce x86_64 3:19.03.9-3.el7 docker-ce-stable 24 M
docker-ce-cli x86_64 1:19.03.9-3.el7 docker-ce-stable 38 M
Installing for dependencies:
container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras-vault 40 k
Transaction Summary
==========================================================================================================================================
[root@10-222-32-10 /etc/yum.repos.d]# 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 Thu 2020-10-29 21:04:30 CST; 4s ago
Docs: https://docs.docker.com
Main PID: 3388 (dockerd)
Tasks: 8
Memory: 39.5M
CGroup: /system.slice/docker.service
└─3388 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.288200182+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc00012ce10, CONNECTING" module=grpc
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.288257574+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc00012ce10, READY" module=grpc
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.310159088+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.310747349+08:00" level=info msg="Loading containers: start."
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.403581691+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option ...d IP address"
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.433103208+08:00" level=info msg="Loading containers: done."
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.446735839+08:00" level=info msg="Docker daemon" commit=039a7df graphdriver(s)=overlay2 version=18.09.9
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.446793798+08:00" level=info msg="Daemon has completed initialization"
Oct 29 21:04:30 10-222-32-10 systemd[1]: Started Docker Application Container Engine.
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.464082388+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.
本文地址:https://blog.csdn.net/xys2015/article/details/109370082