官网地址(不过是centos7):
https://docs.docker.com/engine/install/centos/
1.卸载老版本
sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-engine
2.centos 原有服务升级(可选)
sudo yum -y update
3. 设置存储库
sudo yum install -y yum-utils
sudo yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo
4.安装
sudo yum install -y https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.13-3.2.fc30.x86_64.rpm
sudo yum install docker-ce docker-ce-cli
5.启动
sudo systemctl start docker
6.替换docker源地址
sudo vim /etc/docker/daemon.json
文件中添加一下内容,有该内容可以替换地址:
{
"registry-mirrors":["https://t88rlg2k.mirror.aliyuncs.com"]
}
7.重启
sudo systemctl restart docker