Skip to content

Commit 49375c4

Browse files
authored
Merge pull request #4141 from rust-lang/rustup-2025-01-19
Automatic Rustup
2 parents 5460fbe + 5446955 commit 49375c4

File tree

481 files changed

+8203
-5427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

481 files changed

+8203
-5427
lines changed

Diff for: .github/workflows/ghcr.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Mirror DockerHub images used by the Rust project to ghcr.io.
2+
# Images are available at https://github.com/orgs/rust-lang/packages.
3+
#
4+
# In some CI jobs, we pull images from ghcr.io instead of Docker Hub because
5+
# Docker Hub has a rate limit, while ghcr.io doesn't.
6+
# Those images are pushed to ghcr.io by this job.
7+
#
8+
# Note that authenticating to DockerHub or other registries isn't possible
9+
# for PR jobs, because forks can't access secrets.
10+
# That's why we use ghcr.io: it has no rate limit and it doesn't require authentication.
11+
12+
name: GHCR image mirroring
13+
14+
on:
15+
workflow_dispatch:
16+
schedule:
17+
# Run daily at midnight UTC
18+
- cron: '0 0 * * *'
19+
20+
jobs:
21+
mirror:
22+
name: DockerHub mirror
23+
runs-on: ubuntu-24.04
24+
if: github.repository == 'rust-lang/rust'
25+
permissions:
26+
# Needed to write to the ghcr.io registry
27+
packages: write
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
persist-credentials: false
32+
33+
- name: Log in to registry
34+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
35+
36+
# Download crane in the current directory.
37+
# We use crane because it copies the docker image for all the architectures available in
38+
# DockerHub for the image.
39+
# Learn more about crane at
40+
# https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md
41+
- name: Download crane
42+
run: |
43+
curl -sL "https://github.com/google/go-containerregistry/releases/download/${VERSION}/go-containerregistry_${OS}_${ARCH}.tar.gz" | tar -xzf -
44+
env:
45+
VERSION: v0.20.2
46+
OS: Linux
47+
ARCH: x86_64
48+
49+
- name: Mirror DockerHub
50+
run: |
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+
)
58+
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

Diff for: COPYRIGHT

+21-371
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)