File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments