首先、当然少不了官网文档
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、添加依赖包
$ sudo yum install -y yum-utils
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3、安装社区版docker(免费,但是够用)
$ sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
4、启动docker
$ sudo systemctl start docker
5、查看是否安装成功
dockers -v
6、设置虚拟机环境docker开机自启
$ sudo systemctl enable docker
至此安装完成!!
标签:sudo,ce,yum,liunx,install,docker,安装,latest From: https://www.cnblogs.com/liuaojun/p/16811774.html