Skip to content

feat(docker): publish multi-arch v4 image to ghcr.io#1744

Merged
dimitri merged 2 commits into
mainfrom
feat/v4-docker-multiarch
Jun 27, 2026
Merged

feat(docker): publish multi-arch v4 image to ghcr.io#1744
dimitri merged 2 commits into
mainfrom
feat/v4-docker-multiarch

Conversation

@dimitri

@dimitri dimitri commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Closes #1587.

What

Adds a new .github/workflows/docker-publish-v4.yml that builds and publishes a linux/amd64 + linux/arm64 Docker image for the Clojure/JVM v4 build to ghcr.io/dimitri/pgloader-v4.

Why v4 is the right place for multi-arch

The JVM is ideal for this: clojure -T:build uber produces a platform-independent JAR. The clojure/Dockerfile builder stage now uses --platform=$BUILDPLATFORM, so the Clojure compilation always runs natively on the GitHub Actions host (linux/amd64). QEMU is only needed for the small runtime stage (creating a non-root user, a few shell commands) — trivially fast. There is no multi-hour SBCL cross-compilation under emulation.

The v3 SBCL image is a different story: compiling Common Lisp natively under QEMU takes 2–4 hours on a standard runner, making arm64 there impractical without self-hosted arm64 runners.

Publication strategy

Mirrors the existing v3 workflow:

Event Tag
push to main ghcr.io/dimitri/pgloader-v4:latest
semver tag push ghcr.io/dimitri/pgloader-v4:<version>
pull request build only, no push

A separate image name (pgloader-v4) avoids any tag collision with the v3 pgloader image.

Changes

  • clojure/Dockerfile — add --platform=$BUILDPLATFORM to the builder stage
  • .github/workflows/docker-publish-v4.yml — new workflow (QEMU + buildx + multi-arch push + GHA layer cache + cosign signing)
  • docs/install.rst — add "Docker image (v4)" subsection mentioning ghcr.io/dimitri/pgloader-v4:latest and its arm64 support

Add a new docker-publish-v4.yml workflow that builds and pushes a
linux/amd64 + linux/arm64 Docker image for the Clojure/JVM v4 build
to ghcr.io/dimitri/pgloader-v4.

The JVM is ideally suited for multi-arch: the Clojure build step
produces a platform-independent JAR.  The builder stage in
clojure/Dockerfile now carries --platform=$BUILDPLATFORM so the
Clojure compilation always runs natively on the GitHub Actions host
(linux/amd64), producing the JAR in seconds.  QEMU is only needed
for the runtime stage, where it executes a handful of shell commands
to set up the non-root user — trivially fast.

Publication strategy mirrors the v3 workflow:
  - push to main  → ghcr.io/dimitri/pgloader-v4:latest
  - semver tag    → ghcr.io/dimitri/pgloader-v4:<version>
  - pull request  → build only, no push

GHA build-cache (type=gha) is wired up so layer reuse applies across
both platforms on repeated pushes.

Closes #1587.
Docs: add Docker (v4) subsection to install.rst.
The builder stage creates the JAR at:
  target/pgloader-v4-${PGLOADER_VERSION}.jar  (default 4.0.0-SNAPSHOT)

and a stable symlink target/pgloader.jar pointing to it.
The previous COPY referenced the hardcoded version 0.1.0-SNAPSHOT
which never existed, causing the build to fail.

Use the symlink instead; Docker COPY follows it to the real JAR.
@dimitri dimitri merged commit 3823d41 into main Jun 27, 2026
37 checks passed
@dimitri dimitri deleted the feat/v4-docker-multiarch branch June 27, 2026 06:26
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