Skip to content

Commit 5f49515

Browse files
committed
ci: mirror buildkit image to ghcr
1 parent 0c2c096 commit 5f49515

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

Diff for: .github/workflows/ghcr.yml

+17-6
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,21 @@ jobs:
4848

4949
- name: Mirror DockerHub
5050
run: |
51-
# DockerHub image we want to mirror
52-
image="ubuntu:22.04"
51+
# List of DockerHub images to mirror to ghcr.io
52+
images=(
53+
# Mirrored because used by the mingw-check-tidy, which doesn't cache Docker images
54+
"ubuntu:22.04"
55+
# Mirrored because used by all linux CI jobs, including mingw-check-tidy
56+
"moby/buildkit:buildx-stable-1"
57+
)
5358
54-
# Mirror image from DockerHub to ghcr.io
55-
./crane copy \
56-
docker.io/${image} \
57-
ghcr.io/${{ github.repository_owner }}/${image}
59+
# Mirror each image from DockerHub to ghcr.io
60+
for img in "${images[@]}"; do
61+
echo "Mirroring ${img}..."
62+
# Remove namespace from the image if any.
63+
# E.g. "moby/buildkit:buildx-stable-1" becomes "buildkit:buildx-stable-1"
64+
dest_image=$(echo "${img}" | cut -d'/' -f2-)
65+
./crane copy \
66+
"docker.io/${img}" \
67+
"ghcr.io/${{ github.repository_owner }}/${dest_image}"
68+
done

0 commit comments

Comments
 (0)