ci: migrate from plugins/docker to woodpeckerci/plugin-docker-buildx

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.
This commit is contained in:
Viktor Barzin 2026-03-15 22:52:01 +00:00
parent 55aff55025
commit 546f6957e3
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 24 additions and 48 deletions

View file

@ -42,10 +42,11 @@ steps:
- apt-get update && apt-get install -y --no-install-recommends libglib2.0-0 - 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 - .venv/bin/pytest tests/integration/ tests/regression/ tests/e2e/ tests/test_listing_geojson.py -v --tb=short
- name: build-api-image - name: build-and-push-api
image: plugins/docker image: woodpeckerci/plugin-docker-buildx
environment: depends_on:
DOCKER_BUILDKIT: 1 - test-unit
- test-integration
settings: settings:
username: viktorbarzin username: viktorbarzin
password: password:
@ -54,31 +55,16 @@ steps:
dockerfile: Dockerfile dockerfile: Dockerfile
context: . context: .
target: production target: production
cache_from: platforms:
- viktorbarzin/realestatecrawler:latest - linux/amd64
- viktorbarzin/realestatecrawler:builder tag: ["${CI_PIPELINE_NUMBER}", "latest"]
tags: cache_from: "viktorbarzin/realestatecrawler:latest"
- "build-${CI_PIPELINE_NUMBER}" cache_to: "type=inline"
- 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"'
- name: update-deployment - name: update-deployment
image: alpine image: alpine
depends_on: depends_on:
- publish-api-image - build-and-push-api
commands: commands:
- apk add --no-cache curl jq - apk add --no-cache curl jq
- | - |

View file

@ -53,8 +53,13 @@ steps:
commands: commands:
- cd frontend && npx vitest run --reporter=verbose --shard=4/4 - cd frontend && npx vitest run --reporter=verbose --shard=4/4
- name: build-frontend-image - name: build-and-push-frontend
image: plugins/docker image: woodpeckerci/plugin-docker-buildx
depends_on:
- test-shard-1
- test-shard-2
- test-shard-3
- test-shard-4
settings: settings:
username: viktorbarzin username: viktorbarzin
password: password:
@ -63,31 +68,16 @@ steps:
dockerfile: frontend/Dockerfile dockerfile: frontend/Dockerfile
context: frontend context: frontend
target: production target: production
cache_from: platforms:
- viktorbarzin/immoweb:latest - linux/amd64
tags: tag: ["${CI_PIPELINE_NUMBER}", "latest"]
- "build-${CI_PIPELINE_NUMBER}" cache_from: "viktorbarzin/immoweb:latest"
cache_to: "type=inline"
- 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"'
- name: update-deployment - name: update-deployment
image: alpine image: alpine
depends_on: depends_on:
- publish-frontend-image - build-and-push-frontend
commands: commands:
- apk add --no-cache curl jq - apk add --no-cache curl jq
- | - |