Skip to content

Copy containers between repos


This is especially useful when moving from to the new Artifact registry that Google offer.

That's not to say that you can't use this for copying between private repositories (as long as you're authenticated)


We can use a tool called gcrane

Install gcrane

go install

This will build and install the package to your $PATH

List images

gcrane ls userbradley/searchsploit

We should see something similar to the below

Copy all images to AR

gcrane cp -r userbradley/searchsploit

External sources

Gcrane not working

Somtimes after running the command, it returns with nothing.

I cant explain why it does this, but it's annoying.

Create a file with all the images

gcrane ls userbradley/searchsploit > images.txt

Make sure to remove the at the start of the image, or it breaks

Create a script to copy them one after another


images=$(cat images.txt)

for img in ${images}
    gcrane cp userbradley/searchsploit:${img}${img}

The reason we specify the image name in the script is because when I was running it, it was copying the containers but not the tags

Assign Execute Permissions

chmod +x

Run the copy job



You can replace europe-west2... with any Docker compliant repo. Only tested with GCR and GAR


If you are not copying to GAR

You may want to look at the below

Want to make this site better? Open a PR or help fund hosting costs