CentOS7 安装Docker-CE

1 卸载老版本Docker

1
2
3
4
5
sudo yum remove docker \
docker-common \
docker-selinux \
docker-engine

2 设置仓库

1
2
3
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
1
2
3
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

docker

3 安装docker

1
sudo yum install docker-ce

4 启动Docker

1
sudo systemctl start docker

5 卸载Docker CE

1
2
sudo yum remove docker-ce
sudo rm -rf /var/lib/docker