Skip to content

Commit 33ad3a4

Browse files
Kobzolrami3l
authored andcommitted
Download rust CI Docker images from a registry
1 parent f0d76d0 commit 33ad3a4

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

ci/fetch-rust-docker.bash

+5-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUST_REPO="https://github.com/rust-lang/rust"
1414
ARTIFACTS_BASE_URL="https://ci-artifacts.rust-lang.org/rustc-builds"
1515

1616
# A `Dockerfile` under `rustup`'s `ci/docker` directory may start with `FROM rust-$TARGET`.
17-
# This means it is using an S3-cached Docker image provided by `rustc`'s CI.
17+
# This means it is using a Docker image fetched from a container registry provided by `rustc`'s CI.
1818
LOCAL_DOCKER_TAG="rust-$TARGET"
1919
# The following is a mapping from `$TARGET`s to cached Docker images built from `Dockerfile`s under
2020
# <https://github.com/rust-lang/rust/blob/master/src/ci/docker/host-x86_64/>,
@@ -51,16 +51,11 @@ info="/tmp/image-$image.txt"
5151

5252
rm -f "$info"
5353
curl -o "$info" "$image_url"
54-
digest=$(grep -m1 ^sha "$info")
5554

5655
if [ -z "$(docker images -q "${LOCAL_DOCKER_TAG}")" ]; then
57-
url=$(grep -m1 ^https "$info")
58-
cache=/tmp/rustci_docker_cache
59-
echo "Attempting to download $url"
60-
rm -f "$cache"
61-
set +e
62-
command_retry curl -y 30 -Y 10 --connect-timeout 30 -f -L -C - -o "$cache" "$url"
6356
set -e
64-
docker load --quiet -i "$cache"
65-
docker tag "$digest" "${LOCAL_DOCKER_TAG}"
57+
image_tag=$(cat $info)
58+
echo "Attempting to pull image ${image_tag}"
59+
docker pull "${image_tag}"
60+
docker tag "${image_tag}" "${LOCAL_DOCKER_TAG}"
6661
fi

0 commit comments

Comments
 (0)