Repository navigation
Docker image on Java 21, slim and multi-arch; a workflow publishes it per release - #13
Open
namedgraph wants to merge 2 commits into
Open
namedgraph wants to merge 2 commits into
namedgraph wants to merge 2 commits into
Conversation
… a workflow publishes it per release The image was the Maven build image (1.4 GB, amd64 only) running the jar from target/. It is now a multi-stage build: Maven on eclipse-temurin 21 builds, eclipse-temurin:21-jre runs (about 0.5 GB), for amd64 and arm64. The runnable jar is built with the shade plugin, which merges Jena's META-INF/services files; the assembly plugin keeps one of each, which leaves Jena's initialisation to the order the jars were unpacked in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er Hub user is a repository variable, as LinkedDataHub's Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The
atomgraph/json2rdfimage was the Maven build image (maven:3.8.4-openjdk-17) running the jar fromtarget/. It weighed 1.42 GB and was amd64 only, so Apple Silicon and Graviton hosts ran it emulated. This PR replaces it with a slim Java 21 image and adds a workflow that publishes it for each release.Changes
Dockerfile: a multi-stage build.maven:3.9.11-eclipse-temurin-21builds the jar from the sources, andeclipse-temurin:21-jreruns it (516 MB). The CLI is called the same way as before:docker run -i atomgraph/json2rdf <base>, with JSON on stdin and N-Triples on stdout.pom.xml: the runnable jar is now built bymaven-shade-plugininstead ofmaven-assembly-plugin. Shade'sServicesResourceTransformermerges Jena'sMETA-INF/servicesfiles, which the assembly plugin keeps only one of. That broke Jena's initialisation in CSV2RDF (Docker image on Java 21; a workflow publishes it per release CSV2RDF#11). The classifier is stilljar-with-dependencies, and the compiler release stays at 17..github/workflows/docker.yml: when ajson2rdf-*tag is pushed (or when it is run by hand with a tag), it buildslinux/amd64andlinux/arm64images and pushesatomgraph/json2rdftagged with the full version, the minor version, the major version andlatest(2.2.2,2.2,2,latest), as LinkedDataHub's release does. It needs the repository variableDOCKERHUB_USERNAMEand the secretDOCKERHUB_TOKEN, as LinkedDataHub has them. The arm64 image is built under QEMU emulation, which is fine for a build this small; LinkedDataHub builds on one runner per architecture.Tested
I built the image locally (arm64) and converted a sample JSON with strings, an array and a number, using
-m 1024mandJAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=60.0. The output matches the published image's, includingxsd:float, and the exit code was 0.🤖 Generated with Claude Code