在CentOS 7上在线安装Docker
官方参考网站: https://docs.docker.com/install/linux/docker-ce/centos/
#下载旧的安装包
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
$ sudo yum install docker-ce docker-ce-cli containerd.io
检测安装效果:
$ yum list docker-ce --showduplicates | sort -r
安装测试docker包
$ sudo docker run hello-world