1.安装好Centos 7
2.关闭SELINUX
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
setenforce 0getenforce3.配置阿里云镜像
sudo mkdir -p /etc/dockersudo tee /etc/docker/daemon.json <<-'EOF'{ "registry-mirrors": ["https://8r0xukw1.mirror.aliyuncs.com"]}EOFsudo systemctl daemon-reloadsudo systemctl restart docker 4.停止所有container docker stop $(docker ps -a -q) 5.删除所有container docker rm $(docker ps -a -q) 6.删除全部images docker rmi $(docker images -q)
7.
1.主机A有镜像nginx,版本为v1.0版本。执行命令:
docker save nginx:v1.0 -o /root/nginx.tar ---> 将nginx:v1.0保存为nginx.tar包2.通过scp命令将nginx.tar包拷贝给主机B。3.在主机B上执行命令:docker load -i /root/nginx.tar ---> 从nginx.tar包load为镜像nginx:v1.0注意:执行docker save nginx:v1.0 -o /root/nginx.tar命令,如果不加版本v1.0,会将主机A上所有版本nginx镜像都save到一个nginx.tar包
参考博客:https://blog.csdn.net/silentwolfyh/article/details/52354402