feat(docker): publish multi-arch v4 image to ghcr.io#1744
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1587.
What
Adds a new
.github/workflows/docker-publish-v4.ymlthat builds and publishes a linux/amd64 + linux/arm64 Docker image for the Clojure/JVM v4 build toghcr.io/dimitri/pgloader-v4.Why v4 is the right place for multi-arch
The JVM is ideal for this:
clojure -T:build uberproduces a platform-independent JAR. Theclojure/Dockerfilebuilder 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:
mainghcr.io/dimitri/pgloader-v4:latestghcr.io/dimitri/pgloader-v4:<version>A separate image name (
pgloader-v4) avoids any tag collision with the v3pgloaderimage.Changes
clojure/Dockerfile— add--platform=$BUILDPLATFORMto 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 mentioningghcr.io/dimitri/pgloader-v4:latestand its arm64 support