################# docker ###################
# remove old
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
sudo yum remove -y docker-ce docker-ce-cli containerd.io
# reinstall
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2;
#yum-config-manager \
# --add-repo \
# https://download.docker.com/linux/centos/docker-ce.repo;
# 国内访问docker官方镜像可能会有异常,可以替换为aliyun镜像源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#cp /etc/yum.repos.d.back/* /etc/yum.repos.d/
yum install -y docker-ce-19.03.9 docker-ce-cli-19.03.9 containerd.io
mkdir -pv /root/docker/data
if [ ! -d /etc/docker ]; then
mkdir -pv /etc/docker
fi
cat > /etc/docker/daemon.json <<EOF
{
"live-restore": true,
"data-root": "/root/docker/data",
"exec-opts": [
"native.cgroupdriver=systemd"
],
"insecure-registries": [
],
"registry-mirrors": ["https://r2otk349.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl enable docker
systemctl restart docker
systemctl status docker -l
################# docker end ###################
顶峰相见
For the things you love most
顶峰相见
For the things you love most
也可以下载 Docker 的 rpm 包: 从 Docker 官方网站 下载以下三个包:
docker-ce-*.rpm
docker-ce-cli-*.rpm
containerd.io-*.rpm
手动安装这些包:
启动并启用 Docker:
验证 Docker 安装: