# Look for all source files involves in the COPY command
copied_files=/tmp/.docker-copied-files.txt
rm -f "$copied_files"
- for i in $(sed -n -e 's/^COPY \(.*\) .*$/\1/p' "$docker_dir/$image/Dockerfile"); do
+ for i in $(sed -n -e '/^COPY --from=/! s/^COPY \(.*\) .*$/\1/p' \
+ "$docker_dir/$image/Dockerfile"); do
# List the file names
find "$script_dir/$i" -type f >> $copied_files
done
echo "Attempting to download $url"
rm -f /tmp/rustci_docker_cache
set +e
- retry curl -y 30 -Y 10 --connect-timeout 30 -f -L -C - -o /tmp/rustci_docker_cache "$url"
- loaded_images=$(docker load -i /tmp/rustci_docker_cache | sed 's/.* sha/sha/')
+ retry curl --max-time 600 -y 30 -Y 10 --connect-timeout 30 -f -L -C - \
+ -o /tmp/rustci_docker_cache "$url"
+ echo "Loading images into docker"
+ # docker load sometimes hangs in the CI, so time out after 10 minutes with TERM,
+ # KILL after 12 minutes
+ loaded_images=$(/usr/bin/timeout -k 720 600 docker load -i /tmp/rustci_docker_cache \
+ | sed 's/.* sha/sha/')
set -e
echo "Downloaded containers:\n$loaded_images"
fi