Skip to content

Commit 37be73f

Browse files
committed
[actions] pull container images through Google's Docker Hub mirror
DockerHub's anonymous pull rate limit applies per IP for hours, so retrying cannot ride it out on shared runners; `mirror.gcr.io` serves the same official images without that limit, as the io.js source-install job already does.
1 parent 906fb60 commit 37be73f

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

‎.github/workflows/tests-alpine.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
dl-cdn.alpinelinux.org:80
4747
registry-1.docker.io:443
4848
auth.docker.io:443
49+
mirror.gcr.io:443
4950
production.cloudflare.docker.com:443
5051
production.cloudfront.docker.com:443
5152
- uses: actions/checkout@v6
@@ -68,8 +69,10 @@ jobs:
6869
- run: npm ls urchin
6970
- name: 'Run fast tests on Alpine ${{ matrix.alpine }} (${{ matrix.arch }})'
7071
run: |
72+
# Pull through Google's Docker Hub mirror, which is not subject to Docker Hub's
73+
# anonymous pull rate limits; retry to tolerate transient registry failures
7174
for i in 1 2 3 4 5; do
72-
docker pull alpine:${{ matrix.alpine }} && break
75+
docker pull mirror.gcr.io/library/alpine:${{ matrix.alpine }} && break
7376
echo "docker pull failed, attempt $i/5"; sleep $((i * 5))
7477
done
7578
docker run --rm \
@@ -78,7 +81,7 @@ jobs:
7881
-e "TEST_SHELL=${{ matrix.shell }}" \
7982
-e "TERM=xterm-256color" \
8083
-e "GITHUB_ACTIONS=true" \
81-
alpine:${{ matrix.alpine }} \
84+
mirror.gcr.io/library/alpine:${{ matrix.alpine }} \
8285
sh -c '
8386
set -ex
8487
cat /etc/alpine-release; uname -m
@@ -142,23 +145,26 @@ jobs:
142145
dl-cdn.alpinelinux.org:80
143146
registry-1.docker.io:443
144147
auth.docker.io:443
148+
mirror.gcr.io:443
145149
production.cloudflare.docker.com:443
146150
production.cloudfront.docker.com:443
147151
- uses: actions/checkout@v6
148152
with:
149153
submodules: false
150154
- name: 'Install node ${{ matrix.node }} from a musl binary on Alpine ${{ matrix.alpine }}'
151155
run: |
156+
# Pull through Google's Docker Hub mirror, which is not subject to Docker Hub's
157+
# anonymous pull rate limits; retry to tolerate transient registry failures
152158
for i in 1 2 3 4 5; do
153-
docker pull alpine:${{ matrix.alpine }} && break
159+
docker pull mirror.gcr.io/library/alpine:${{ matrix.alpine }} && break
154160
echo "docker pull failed, attempt $i/5"; sleep $((i * 5))
155161
done
156162
docker run --rm \
157163
-v "${{ github.workspace }}:/workspace" \
158164
-w /workspace \
159165
-e "NODE_VERSION=${{ matrix.node }}" \
160166
-e "TERM=xterm-256color" \
161-
alpine:${{ matrix.alpine }} \
167+
mirror.gcr.io/library/alpine:${{ matrix.alpine }} \
162168
sh -c '
163169
set -ex
164170
cat /etc/alpine-release; uname -m

‎.github/workflows/tests-installation-node.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
production.cloudfront.docker.com:443
4545
registry-1.docker.io:443
4646
auth.docker.io:443
47+
mirror.gcr.io:443
4748
- uses: actions/checkout@v6
4849
id: checkout
4950
continue-on-error: true
@@ -65,9 +66,10 @@ jobs:
6566
- run: npx which urchin
6667
- name: Run installation_node tests in container
6768
run: |
68-
# Retry the image pull to tolerate transient Docker registry failures
69+
# Pull through Google's Docker Hub mirror, which is not subject to Docker Hub's
70+
# anonymous pull rate limits; retry to tolerate transient registry failures
6971
for i in 1 2 3 4 5; do
70-
docker pull ubuntu:16.04 && break
72+
docker pull mirror.gcr.io/library/ubuntu:16.04 && break
7173
echo "docker pull failed, attempt $i/5"
7274
sleep $((i * 5))
7375
done
@@ -79,7 +81,7 @@ jobs:
7981
-e "DEBIAN_FRONTEND=noninteractive" \
8082
-e "GITHUB_ACTIONS=true" \
8183
-e "WITHOUT_CURL=${{ matrix.without_curl }}" \
82-
ubuntu:16.04 \
84+
mirror.gcr.io/library/ubuntu:16.04 \
8385
bash -c '
8486
set -ex
8587

‎.github/workflows/tests-xenial.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
production.cloudfront.docker.com:443
4242
registry-1.docker.io:443
4343
auth.docker.io:443
44+
mirror.gcr.io:443
4445
- uses: actions/checkout@v6
4546
id: checkout
4647
continue-on-error: true
@@ -62,9 +63,10 @@ jobs:
6263
- run: npx which urchin
6364
- name: Run xenial tests in container
6465
run: |
65-
# Retry the image pull to tolerate transient Docker registry failures
66+
# Pull through Google's Docker Hub mirror, which is not subject to Docker Hub's
67+
# anonymous pull rate limits; retry to tolerate transient registry failures
6668
for i in 1 2 3 4 5; do
67-
docker pull ubuntu:16.04 && break
69+
docker pull mirror.gcr.io/library/ubuntu:16.04 && break
6870
echo "docker pull failed, attempt $i/5"
6971
sleep $((i * 5))
7072
done
@@ -75,7 +77,7 @@ jobs:
7577
-e "TERM=xterm-256color" \
7678
-e "DEBIAN_FRONTEND=noninteractive" \
7779
-e "GITHUB_ACTIONS=true" \
78-
ubuntu:16.04 \
80+
mirror.gcr.io/library/ubuntu:16.04 \
7981
bash -c '
8082
set -ex
8183

0 commit comments

Comments
 (0)