Skip to content

Commit 6ca13d0

Browse files
committed
CI: fix Docker layer caching
1 parent f1b8548 commit 6ca13d0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ci/docker/run.sh

+11
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
6363
uname -m >> $hash_key
6464

6565
docker --version >> $hash_key
66+
67+
# Include cache version. Currently it is needed to bust Docker
68+
# cache key after opting in into the old Docker build backend.
69+
echo "1" >> $hash_key
70+
6671
cksum=$(sha512sum $hash_key | \
6772
awk '{print $1}')
6873

@@ -90,6 +95,12 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
9095
context="$script_dir"
9196
fi
9297
echo "::group::Building docker image for $image"
98+
99+
# As of August 2023, Github Actions have updated Docker to 23.X,
100+
# which uses the BuildKit by default. It currently throws aways all
101+
# intermediate layers, which breaks our usage of S3 layer caching.
102+
# Therefore we opt-in to the old build backend for now.
103+
export DOCKER_BUILDKIT=0
93104
retry docker \
94105
build \
95106
--rm \

0 commit comments

Comments
 (0)