To Copy datas into ou out from China region, we need Data Transfer Hub.
https://aws.amazon.com/solutions/implementations/data-transfer-hub/
Sometimes it is necessary to copy public docker images to private ECR repo.
We can manually do this using manual scripts.
This script will list all running docker image in a Kubernetes cluster, and create a file with all the images
./list-docker-images.sh
Will Download and tag all images listed in the file to be stored on the new registry.
./copy-to-ecr.sh
Connect with SSM to an EKS host and try do download docker images
Authenticate on Registry
ECR=376520866342.dkr.ecr.cn-north-1.amazonaws.com.cn/kubernetes
aws ecr get-login-password --region cn-north-1 | docker login --username AWS --password-stdin $ECR
Retrieve docker credential
ECR_CRED=$(cat ~/.docker/config.json | jq '.auths."376520866342.dkr.ecr.cn-north-1.amazonaws.com.cn".auth' -r | base64 -d)
#nerdctl pull 048912060910.dkr.ecr.cn-northwest-1.amazonaws.com.cn/quay/argoproj/argocd:1.8.0 #ctr image pull 048912060910.dkr.ecr.cn-northwest-1.amazonaws.com.cn/gcr/google_containers:0.7.5