vi /etc/hosts # 本地虚拟机 10.10.50.204 registry.yourcompany.com
# 离线环境 10.10.51.77 registry.yourcompany.com
配置Docker允许HTTP
1 2
vi /etc/docker/daemon.json { "insecure-registries":["registry.yourcompany.com:5000"] }
镜像导出脚本
repo_save.sh
1 2 3 4 5 6 7 8
images=( tomcat/tomcat-oraclejdk8:8.5.50 )
for imageName in${images[@]} ; do docker pull registry.yourcompany.com:5000/$imageName docker save registry.yourcompany.com:5000/$imageName > $imageName.tar done
镜像导入脚本
repo_load.sh
1 2 3 4 5 6 7 8
images=( tomcat/tomcat-oraclejdk8:8.5.50 )
for imageName in${images[@]} ; do docker load < $imageName.tar docker push registry.yourcompany.com:5000/$imageName done
手工导出导入
1 2 3 4 5 6 7
# 导出 docker pull registry.yourcompany.com:5000/yourimage:2.2.0 docker save registry.yourcompany.com:5000/yourimage:2.2.0 > yourimage:2.2.0.tar