From 8caaed0fe79f021eac2fdd17d98d3b4b31f1828a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 5 Jun 2024 10:40:56 +0000 Subject: [PATCH] ci: fix Docker buildx caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit 00596caaf91d ("ci: docker: bump containers to Docker version 26") we've updated from Docker version 19 to latest 26 which made the LCM container CI test job failing as both lcm-test-x86-64-v1 and lcm-test-x86-64-v2 containers containers are same, so the test checking for different content of /etc/container-version fails: docker run registry.gitlab.com/prpl-foundation/prplos/lcm-test-x86-64-v1:prplos cat /etc/container-version 1 docker run registry.gitlab.com/prpl-foundation/prplos/lcm-test-x86-64-v2:prplos cat /etc/container-version 1 It seems, that this new Docker version changed somehow the behavior of layer caching and thus Docker is no longer able to find out if the content defined in `ADD ./ /` changed, thus reusing the cached layers. So lets fix it by pruning the Docker build cache before each v1/v2 container build, so we're sure, that no cache is being used. I would like to point out, that I've tried to use `docker build --no-cache` first, but it didn't worked out. Fixes: 00596caaf91d ("ci: docker: bump containers to Docker version 26") Signed-off-by: Petr Štetiar --- .gitlab/docker/ib/lcm/scripts/build-push-lcm-containers.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab/docker/ib/lcm/scripts/build-push-lcm-containers.sh b/.gitlab/docker/ib/lcm/scripts/build-push-lcm-containers.sh index a252732a7c..0be67107c1 100644 --- a/.gitlab/docker/ib/lcm/scripts/build-push-lcm-containers.sh +++ b/.gitlab/docker/ib/lcm/scripts/build-push-lcm-containers.sh @@ -59,6 +59,8 @@ build_push_container() mkdir -p "$rootfs_dir" tar -C "$rootfs_dir" -xf "$rootfs" + docker buildx prune --force + docker build \ --tag "$container_name" \ --file .gitlab/docker/ib/lcm/Dockerfile \