How to copy images from GHCR to ACR

603 views Asked by At

Looking for an example in GitHub actions workflow to clone a specifc image name by commit SHA from GHCR (GitHub registry) to ACR (Azure registry) with a need to copy all the tags and labels from the source repository to the target.

At the moment, I'm using Docker pull and push commands, but didn't find a way to fetch all the tags for given image sha from GHCR.

Appreciate your help,

Thanks.

1

There are 1 answers

0
Venkatesan On

I tried in my environment and got beow results:

To copy Github container registry to azure container registry, You can use the following this command.

Command:

az login
az acr login -n < your acr container registry >

az acr import \
  --name <container registry > \
  --source <ghcr.io/< username >/image:latest \
  --username <Git-hub RegistryUsername> \
  --password <Git-hub RegistryPassword>

Console:

enter image description here

Portal:

enter image description here

For more reference:

Import container images - Azure Container Registry | Microsoft Learn