From 546f6957e313c0bd6e9613dcae242a13fa0c70c9 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 15 Mar 2026 22:52:01 +0000 Subject: [PATCH] ci: migrate from plugins/docker to woodpeckerci/plugin-docker-buildx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the old Docker-in-Docker build approach (plugins/docker) with the modern buildx plugin that natively supports BuildKit. This fixes: - "Cannot connect to the Docker daemon" errors (no DinD needed) - "the --mount option requires BuildKit" errors (buildx = BuildKit) - OOM in publish step (skopeo no longer needed, buildx pushes directly) Also removes the intermediate build-tag/skopeo-copy/publish dance — buildx pushes both versioned and latest tags in a single step. --- .woodpecker/api.yml | 36 +++++++++++------------------------- .woodpecker/frontend.yml | 36 +++++++++++++----------------------- 2 files changed, 24 insertions(+), 48 deletions(-) diff --git a/.woodpecker/api.yml b/.woodpecker/api.yml index 62028c1..0202f26 100644 --- a/.woodpecker/api.yml +++ b/.woodpecker/api.yml @@ -42,10 +42,11 @@ steps: - apt-get update && apt-get install -y --no-install-recommends libglib2.0-0 - .venv/bin/pytest tests/integration/ tests/regression/ tests/e2e/ tests/test_listing_geojson.py -v --tb=short - - name: build-api-image - image: plugins/docker - environment: - DOCKER_BUILDKIT: 1 + - name: build-and-push-api + image: woodpeckerci/plugin-docker-buildx + depends_on: + - test-unit + - test-integration settings: username: viktorbarzin password: @@ -54,31 +55,16 @@ steps: dockerfile: Dockerfile context: . target: production - cache_from: - - viktorbarzin/realestatecrawler:latest - - viktorbarzin/realestatecrawler:builder - tags: - - "build-${CI_PIPELINE_NUMBER}" - - - name: publish-api-image - image: alpine - depends_on: - - test-unit - - test-integration - - build-api-image - environment: - DOCKERHUB_TOKEN: - from_secret: dockerhub-token - commands: - - apk add --no-cache skopeo - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/realestatecrawler:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/realestatecrawler:${CI_PIPELINE_NUMBER}"' - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/realestatecrawler:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/realestatecrawler:latest"' - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/realestatecrawler:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/realestatecrawler:builder"' + platforms: + - linux/amd64 + tag: ["${CI_PIPELINE_NUMBER}", "latest"] + cache_from: "viktorbarzin/realestatecrawler:latest" + cache_to: "type=inline" - name: update-deployment image: alpine depends_on: - - publish-api-image + - build-and-push-api commands: - apk add --no-cache curl jq - | diff --git a/.woodpecker/frontend.yml b/.woodpecker/frontend.yml index 43b5c70..e5c58c7 100644 --- a/.woodpecker/frontend.yml +++ b/.woodpecker/frontend.yml @@ -53,8 +53,13 @@ steps: commands: - cd frontend && npx vitest run --reporter=verbose --shard=4/4 - - name: build-frontend-image - image: plugins/docker + - name: build-and-push-frontend + image: woodpeckerci/plugin-docker-buildx + depends_on: + - test-shard-1 + - test-shard-2 + - test-shard-3 + - test-shard-4 settings: username: viktorbarzin password: @@ -63,31 +68,16 @@ steps: dockerfile: frontend/Dockerfile context: frontend target: production - cache_from: - - viktorbarzin/immoweb:latest - tags: - - "build-${CI_PIPELINE_NUMBER}" - - - name: publish-frontend-image - image: alpine - depends_on: - - test-shard-1 - - test-shard-2 - - test-shard-3 - - test-shard-4 - - build-frontend-image - environment: - DOCKERHUB_TOKEN: - from_secret: dockerhub-token - commands: - - apk add --no-cache skopeo - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/immoweb:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/immoweb:${CI_PIPELINE_NUMBER}"' - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/immoweb:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/immoweb:latest"' + platforms: + - linux/amd64 + tag: ["${CI_PIPELINE_NUMBER}", "latest"] + cache_from: "viktorbarzin/immoweb:latest" + cache_to: "type=inline" - name: update-deployment image: alpine depends_on: - - publish-frontend-image + - build-and-push-frontend commands: - apk add --no-cache curl jq - |