一、部署环境
- 操作系统:CentOS Linux release 7.8.2003 (Core)
- 防火墙:关闭
- SELinux:关闭
二、部署过程
rm -rf /etc/yum.repos.d/*.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install yum-utils device-mapper-persistent-data lvm2 -y
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum clean all
yum makecache fast
yum list docker-ce --showduplicates
yum install docker-ce-18.09.9-3.el7 docker-ce-cli-18.09.9-3.el7 -y
systemctl enable docker
systemctl start docker
systemctl status docker
docker version
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://yln6o2wd.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
docker pull hello-world
docker images
docker run hello-world
docker ps -a