Надо сменить тег для образа контейнера, который используется во время билда в Китае и загрузить его к китайский же private registry.
Запуск registry описан в посте Docker: private registry в AWS [China] с S3 storage.
Загружаем образ с европейского JFrog Artifactory:
[simterm]
$ sudo docker pull engineering-docker.jfrog.io/ci-website:latest [sudo] password for setevoy: latest: Pulling from engineering-docker.jfrog.io/ci-website cacc99976415: Pull complete ... 3cdd3d892d64: Pull complete Digest: sha256:c1e3cab26c8e2d2396b91c5e4c45e43588779e776851e6fdbb3919a5d34e840b Status: Downloaded newer image for engineering-docker.jfrog.io/ci-website:latest
[/simterm]
Находим ID образа:
[simterm]
$ sudo docker images | grep ci-website engineering-docker.jfrog.io/ci-website latest 3cdd3d892d64 15 months ago 490.6 MB
[/simterm]
Используя ID устанавливаем новый тег с URL уже китайского private registry:
[simterm]
$ sudo docker tag 3cdd3d892d64 registry.domain.cn:5000/ci-website:latest
[/simterm]
Проверяем:
[simterm]
$ sudo docker images | grep ci-website engineering-docker.jfrog.io/ci-website latest 3cdd3d892d64 15 months ago 490.6 MB registry.domain.cn:5000/ci-website latest 3cdd3d892d64 15 months ago 490.6 MB
[/simterm]
Логинимся на registry в Китай:
[simterm]
$ sudo docker login registry.domain.cn:5000 Username: user.docker Password: Email: [email protected] WARNING: login credentials saved in /root/.docker/config.json Login Succeeded
[/simterm]
Пушим:
[simterm]
$ sudo docker push registry.domain.cn:5000/ci-website The push refers to a repository [registry.domain.cn:5000/ci-website] (len: 1) 3cdd3d892d64: Image already exists 4333985efc60: Image successfully pushed cc371ad67565: Buffering to Disk ...
[/simterm]
Проверяем:
[simterm]
$ sudo docker pull registry.domain.cn:5000/ci-website [sudo] password for setevoy: latest: Pulling from registry.domain.cn:5000/ci-website ... 3cdd3d892d64: Already exists Digest: sha256:569eb176efb5ee869cc5f68e056396023c4c58cc2aa21bb5d4e5bbd9f16ef498 Status: Image is up to date for registry.domain.cn:5000/ci-website:latest
[/simterm]
Готово.