From f6ccd895df85ab6642ef2c5dcc336acc5990f4fd Mon Sep 17 00:00:00 2001 From: will Date: Tue, 5 Aug 2025 14:41:09 +0100 Subject: [PATCH] ci: use buildx in ci Github-Pull: #32989 Rebased-From: 94a09325475 This rebase also includes part of e87429a2d0f23eb59526d335844fa5ff5b50b21f adding `$DOCKER_BUILD_CACHE_ARG \` to the `docker build` command. Using buildx is required to properly load the correct driver, for use with registry caching. Neither build, nor BUILDKIT=1 currently do this properly. Use of `docker buildx build` is compatible with podman. --- ci/test/02_run_container.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/test/02_run_container.sh b/ci/test/02_run_container.sh index afd447c347f..9255c27beb8 100755 --- a/ci/test/02_run_container.sh +++ b/ci/test/02_run_container.sh @@ -17,11 +17,15 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then docker run --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append "/tmp/env-$USER-$CONTAINER_NAME" echo "Creating $CI_IMAGE_NAME_TAG container to run in" - DOCKER_BUILDKIT=1 docker build \ + # Use buildx unconditionally + # Using buildx is required to properly load the correct driver, for use with registry caching. Neither build, nor BUILDKIT=1 currently do this properly + # shellcheck disable=SC2086 + docker buildx build \ --file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \ --build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \ --build-arg "FILE_ENV=${FILE_ENV}" \ --label="${CI_IMAGE_LABEL}" \ + $DOCKER_BUILD_CACHE_ARG \ --tag="${CONTAINER_NAME}" \ "${BASE_READ_ONLY_DIR}"