Skip to content

Publish Docker images to Docker Hub and GHCR on tag#51

Merged
HelgeSverre merged 1 commit into
mainfrom
docker-publish
May 12, 2026
Merged

Publish Docker images to Docker Hub and GHCR on tag#51
HelgeSverre merged 1 commit into
mainfrom
docker-publish

Conversation

@HelgeSverre
Copy link
Copy Markdown
Owner

Summary

  • New root Dockerfile (multi-stage rust:slim-bookwormdebian:bookworm-slim). Includes g++/cmake so the bundled duckdb C++ build succeeds.
  • New .dockerignore to keep the build context small.
  • New .github/workflows/docker.yml:
    • on tag push v*: build multi-arch (linux/amd64, linux/arm64) and push to both docker.io/<DOCKERHUB_USERNAME>/sql-splitter and ghcr.io/<owner>/sql-splitter
    • on PR touching build inputs: amd64 dry-run, no push (so the next merge isn't blind)
    • workflow_dispatch with a tag input: builds and publishes that ref (use this to backfill old releases)

Tags applied per image (via docker/metadata-action):

  • 1.13.5, 1.13, 1, latest (when the ref is the highest semver)
  • the literal ref name (v1.13.5) for parity with the GitHub tag

Before merging

Add two repo secrets (Settings → Secrets and variables → Actions):

  • DOCKERHUB_USERNAME — your Docker Hub user (e.g. helgesverre)
  • DOCKERHUB_TOKEN — a Docker Hub access token (Account Settings → Security → New Access Token, scoped read/write/delete on the repo)

GHCR uses the workflow's GITHUB_TOKEN — no extra secret needed.

After merging

Backfill old releases by running the workflow once per existing tag:

gh workflow run docker.yml --repo HelgeSverre/sql-splitter -f tag=v1.13.4

(I'll do this for all ~30 tags once secrets are set.)

Test plan

  • PR check builds the image successfully on amd64
  • DOCKERHUB_USERNAME + DOCKERHUB_TOKEN secrets added to repo
  • After merge, dispatch a single backfill (e.g. v1.13.5) and verify it appears on https://hub.docker.com/r//sql-splitter
  • docker run --rm <user>/sql-splitter:latest --version prints the version
  • Backfill remaining tags via workflow_dispatch loop

🤖 Generated with Claude Code

- Add multi-stage Dockerfile (rust:slim-bookworm -> debian:bookworm-slim)
  with g++/cmake for the bundled duckdb C++ build.
- Add .dockerignore to keep the build context small.
- Add docker.yml workflow: on tag push, builds multi-arch (amd64+arm64)
  and pushes to docker.io/<user>/sql-splitter and
  ghcr.io/<owner>/sql-splitter with semver-derived tags. PRs that touch
  build inputs get a build-only dry run; workflow_dispatch accepts a
  tag input for backfilling existing releases.

Requires DOCKERHUB_USERNAME + DOCKERHUB_TOKEN secrets on the repo
before the first publish.
@HelgeSverre HelgeSverre merged commit 2a7c04a into main May 12, 2026
12 checks passed
@HelgeSverre HelgeSverre deleted the docker-publish branch May 12, 2026 10:29
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