官方安装链接(CentOS):https://docs.docker.com/engine/install/centos/
删除之前安装痕迹:
1 2 3 4 5 6 7 8 9 10 11
| yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine \ docker-ce
|
1 2
| sudo yum install -y yum-utils device-mapper-persistent-data lvm2
|
1 2 3
| sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sudo yum makecache fast
|
1 2
| sudo yum -y install docker-ce
|
1 2 3 4
| systemctl stop firewalld
systemctl disable firewalld
|
1 2 3
| systemctl start docker systemctl enable docker
|
1 2 3 4 5 6 7 8
| sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["你的加速器地址"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
|