about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2023-08-12 18:55:13 +0200
committerJakub Beránek <berykubik@gmail.com>2023-08-12 18:55:13 +0200
commit6ca13d051b1fce4e7253eb6f7106173ac10a9858 (patch)
treee0a9c853bde1afdbae4d09041d3e320ed837f0c5 /src
parentf1b854818db00bec14accbc9d1c72e6ebefe64db (diff)
downloadrust-6ca13d051b1fce4e7253eb6f7106173ac10a9858.tar.gz
rust-6ca13d051b1fce4e7253eb6f7106173ac10a9858.zip
CI: fix Docker layer caching
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ci/docker/run.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh
index 87db964a15f..8bd8beb873b 100755
--- a/src/ci/docker/run.sh
+++ b/src/ci/docker/run.sh
@@ -63,6 +63,11 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
       uname -m >> $hash_key
 
       docker --version >> $hash_key
+
+      # Include cache version. Currently it is needed to bust Docker
+      # cache key after opting in into the old Docker build backend.
+      echo "1" >> $hash_key
+
       cksum=$(sha512sum $hash_key | \
         awk '{print $1}')
 
@@ -90,6 +95,12 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
         context="$script_dir"
     fi
     echo "::group::Building docker image for $image"
+
+    # As of August 2023, Github Actions have updated Docker to 23.X,
+    # which uses the BuildKit by default. It currently throws aways all
+    # intermediate layers, which breaks our usage of S3 layer caching.
+    # Therefore we opt-in to the old build backend for now.
+    export DOCKER_BUILDKIT=0
     retry docker \
       build \
       --rm \