Skip to content

Add multi-arch Docker build CI/CD workflow (amd64 + arm64)#1169

Open
antoinetielbeke wants to merge 1 commit into
CatoTH:mainfrom
antoinetielbeke:feature/docker-multiarch-ci
Open

Add multi-arch Docker build CI/CD workflow (amd64 + arm64)#1169
antoinetielbeke wants to merge 1 commit into
CatoTH:mainfrom
antoinetielbeke:feature/docker-multiarch-ci

Conversation

@antoinetielbeke
Copy link
Copy Markdown
Contributor

@antoinetielbeke antoinetielbeke commented May 31, 2026

Summary

Automates building and publishing the official Docker image (tobiashoessl/antragsgruen) for both amd64 and arm64 architectures on every release.

This mirrors the manual command already documented in docs/create-dist.sh (line 7):

docker buildx build --platform linux/amd64,linux/arm64 --build-arg APP_ARCHIVE=... -t tobiashoessl/antragsgruen:... --push .

Why multi-arch / ARM support?

We (Volt Europa) run Antragsgruen on an ARM-based Kubernetes cluster, and the current single-arch amd64 image is unusable for us.

What it does

Trigger Action
Release published Builds + pushes multi-arch image (Docker Hub + GHCR)
Push to main (path-filtered) Builds + pushes main-tagged image
PR against docker files Build-only (no push) for validation
workflow_dispatch Manual build with optional version override

The distribution tarball is generated inline (matching docs/create-dist.sh), then fed into the Docker build via APP_ARCHIVE build arg — preserving the exact same deployment artifact your Apache Dockerfile expects.

Question for you: Docker Hub only or also GHCR?

I configured it to push to both Docker Hub (tobiashoessl/antragsgruen) and GitHub Container Registry (ghcr.io/tobiashoessl/antragsgruen). GHCR has the advantage of:

  • No rate limits for pullers
  • Tight GitHub integration (package attached to the repo)
  • GITHUB_TOKEN auto-generated (no secret setup needed)

But if you prefer to keep it Docker Hub only, I can simplify to one registry. What do you think?

Required secrets

To enable the Docker Hub push, you need to add two repository secrets:

  • DOCKER_HUB_USERNAME
  • DOCKER_HUB_TOKEN

The GHCR push uses the auto-generated GITHUB_TOKEN and needs no extra setup.

Verification

You can test the workflow by running it via workflow_dispatch from the Actions tab before any release. On PRs, it builds without pushing so you can verify the Dockerfile compiles correctly.

Automates building and publishing the official Docker image
(tobiashoessl/antragsgruen) for both amd64 and arm64 on every
release.

Key features:
- Multi-arch builds: linux/amd64 + linux/arm64 via QEMU + Buildx
- Automated release workflow triggered on GitHub Releases
- Also runs on pushes to main (path-filtered) and PRs (dry-run)
- Manual dispatch with optional version override
- Pushes to Docker Hub and GitHub Container Registry
- Generates distribution tarball matching create-dist.sh behavior
- Build caching via GitHub Actions cache for faster rebuilds

Required secrets:
- DOCKER_HUB_USERNAME: Docker Hub username
- DOCKER_HUB_TOKEN: Docker Hub access token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant