Skip to content

Instantly share code, notes, and snippets.

@datfinesoul
Last active June 12, 2020 04:55
Show Gist options
  • Save datfinesoul/0c2f83777a1d5dfb1a69c0d038201773 to your computer and use it in GitHub Desktop.
Save datfinesoul/0c2f83777a1d5dfb1a69c0d038201773 to your computer and use it in GitHub Desktop.
ECR Notes

Tag an <untagged> ECR image in China

export AWS_PROFILE="<profile>"
aws ecr get-login-password --region cn-north-1 | \
  docker login --username AWS --password-stdin <account_id>.dkr.ecr.cn-north-1.amazonaws.com.cn
MANIFEST=$( \
  aws ecr batch-get-image --repository-name <ecr_repo_name> \
  --image-ids imageDigest=sha256:<sha> \
  --query 'images[].imageManifest' --output text \
  )
aws ecr put-image --repository-name <ecr_repo> --image-tag <tagname> --image-manifest "$MANIFEST"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment