1 min read

Easy move container images between registries with single command

How many "docker tag .." have you done in your whole life?! (Don't lie) Crane allows you to easily move an image directly from the source to the destination in a single command way. That's great!
Easy move container images between registries with single command
Happiness while not using `docker tag ` anymore

docker tag .. is one of the most no-sense command from the users side, talking about moving container images between registries.

Solution

Use crane tool (made by Google!).

# authenticate to the destination registry (do the same with source registry based on needs)
crane auth login my-registry.net -u AzureDiamond -p hunter2


# copy nginx image from dockerhub to my-registry.net
crane copy nginx:latest my-registry.net/nginx:latest

That's all!

Official reference

go-containerregistry/cmd/crane/doc/crane.md at main · google/go-containerregistry
Go library and CLIs for working with container registries - google/go-containerregistry
Tweets by YBacciarini