1.卸载旧版本
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
2.安装所需要的包
yum install -y yum-utils device-mapper-persistent-data lvm2
3.使用以下命令设置稳定的存储库
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.更新 yum 缓存
yum makecache fast
5.安装 Docker-ce:
yum -y install docker-ce
6.Docker 后台服务
systemctl start docker
7.测试运行 hello-world
docker run hello-world
切换回Linux控制台,输入: vim /etc/docker/daemon.json ,在这个json文件里写入刚才保存的地址,保存后退出!
{ "registry-mirrors": ["http://hub-mirror.c.163.com"] }
参与评论
手机查看
返回顶部