Skip to content

Commit 67389f1

Browse files
committed
CI: avoid hitting Docker Hub rate limit
Signed-off-by: Akihiro Suda <[email protected]>
1 parent d03a9a8 commit 67389f1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

hack/test-example.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ INFO "Starting \"$NAME\" from \"$FILE\""
5858
trap 'limactl delete -f $NAME' EXIT
5959
set -x
6060
if ! limactl start --tty=false "$FILE"; then
61-
ERROR "Failed to start \"$NAME\""
62-
tail "$HOME/.lima/${NAME}"/*.log
63-
exit 1
61+
ERROR "Failed to start \"$NAME\""
62+
tail "$HOME/.lima/${NAME}"/*.log
63+
exit 1
6464
fi
6565

6666
limactl shell "$NAME" uname -a
@@ -102,8 +102,10 @@ if [[ -n "${CHECKS["containerd-user"]}" ]]; then
102102
INFO "Run a nginx container with port forwarding 127.0.0.1:8080"
103103
set -x
104104
limactl shell "$NAME" nerdctl info
105-
limactl shell "$NAME" sh -ec "nerdctl pull nginx:alpine >/dev/null"
106-
limactl shell "$NAME" nerdctl run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine
105+
# Use GHCR to avoid hitting Docker Hub rate limit
106+
nginx_image="ghcr.io/stargz-containers/nginx:1.19-alpine-org"
107+
limactl shell "$NAME" sh -ec "nerdctl pull ${nginx_image} >/dev/null"
108+
limactl shell "$NAME" nerdctl run -d --name nginx -p 127.0.0.1:8080:80 ${nginx_image}
107109

108110
timeout 3m bash -euxc "until curl -f --retry 30 --retry-connrefused http://127.0.0.1:8080; do sleep 3; done"
109111

0 commit comments

Comments
 (0)