Skip to content

Instantly share code, notes, and snippets.

@iwanbolzern
Created June 17, 2019 10:49
Show Gist options
  • Save iwanbolzern/b5ac601f678c6207b9671183f9e7a8e2 to your computer and use it in GitHub Desktop.
Save iwanbolzern/b5ac601f678c6207b9671183f9e7a8e2 to your computer and use it in GitHub Desktop.
Migrate docker repository from hub.docker.com into private registry
original_image="iwanbolzern/my-awesome-repo"
new_name="iwanbolzern/my-awesome-repo"
target_acr="my-private-registry:5000"
# Download all images
docker pull $original_image --all-tags
# retag image and push to new acr
docker images $original_image \
--format "docker tag {{.Repository}}:{{.Tag}} $target_acr/$new_name:{{.Tag}} | docker push $target_acr/$new_name:{{.Tag}}" |
bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment