官方安装文档地址:https://docs.docker.com/engine/install/centos/
1.卸载旧版本docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2.下载软件包并设置储存库
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3.安装docker
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
4.启动docker
sudo systemctl start docker sudo mkdir -p /etc/docker
查看版本:docker -v
查看已安装镜像:docker images
设置开机自启: systemctl enable docker
5.配置镜像加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://zfqkbu7u.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
标签:sudo,ce,systemctl,yum,Linux,docker,安装
From: https://www.cnblogs.com/wanglufi/p/16666729.html