From 2516e783ba88d54e04896e2a553fcadb547691b7 Mon Sep 17 00:00:00 2001 From: Tom Foster Date: Sat, 6 Sep 2025 15:55:24 +0100 Subject: [PATCH] ci: Support optional persistent BuildKit endpoints in Docker builds Allows us to use runners with persistent BuildKit containers for improved caching and faster build times. Falls back to standard docker-container driver when BUILDKIT_ENDPOINT environment variable is not set. --- .forgejo/workflows/release-image.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.forgejo/workflows/release-image.yml b/.forgejo/workflows/release-image.yml index b1a26e24..2b3d481f 100644 --- a/.forgejo/workflows/release-image.yml +++ b/.forgejo/workflows/release-image.yml @@ -105,6 +105,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + # Use persistent BuildKit if BUILDKIT_ENDPOINT is set (e.g. tcp://buildkit:8125) + driver: ${{ env.BUILDKIT_ENDPOINT != '' && 'remote' || 'docker-container' }} + endpoint: ${{ env.BUILDKIT_ENDPOINT || '' }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. @@ -262,6 +266,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + # Use persistent BuildKit if BUILDKIT_ENDPOINT is set (e.g. tcp://buildkit:8125) + driver: ${{ env.BUILDKIT_ENDPOINT != '' && 'remote' || 'docker-container' }} + endpoint: ${{ env.BUILDKIT_ENDPOINT || '' }} - name: Extract metadata (tags) for Docker id: meta