https://docs.docker.com/install/linux/docker-ce/centos/#install-using-the-convenience-script
安装
yum install -y gcc
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce
systemctl start docker
systemctl enable docker
docker version
mkdir -p /etc/docker
vi /etc/docker/daemon.json
{"registry-mirrors":["https://tzi94mpq.mirror.aliyuncs.com"]}
systemctl daemon-reload
systemctl restart docker
卸载
yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-selinux
docker-engine-selinux
docker-engine
systemctl stop docker
yum remove docker-ce
rm -rf /var/lib/docker
2019-03-19 补充
网络慢,下载镜像慢,终止了,文件可能被锁了。卸了B的,重装。
记得删除/etc/docker/daemon.json
网友评论