删除旧版
1
sudo yum remove docker docker-common docker-selinux docker-engine
安装库
1
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
配置stable repo
1
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装
1
sudo yum install docker-ce
启动
1
sudo systemctl start docker
开机启动
1
sudo systemctl enable docker
7 . hello world1
sudo docker run hello-world