Minimal Docker image with GraalVM + Maven installed via SDKMAN!. Use it to build JVM apps and GraalVM native images without installing toolchains locally.
Images are automatically published on Docker Hub and GHCR when a git tag is pushed.
- GraalVM: 25-graalce
- Maven: 3.9.11
- Architectures:
linux/amd64,linux/arm64 - Registries:
- Docker Hub:
softinstigate/graalvm-maven - GitHub Container Registry:
ghcr.io/softinstigate/graalvm-maven
- Docker Hub:
- Useful tags:
latest(tracks the most recent release)25-graalce(current main)- Historical examples:
24.0.2-graalce,22.0.2-graalce,21.0.2-graalce
Browse tags on:
- Docker Hub: https://hub.docker.com/r/softinstigate/graalvm-maven/tags
- GHCR: https://github.com/SoftInstigate/graalvm-maven-docker/pkgs/container/graalvm-maven
# Docker Hub
docker pull softinstigate/graalvm-maven:25-graalce
# Or GHCR
docker pull ghcr.io/softinstigate/graalvm-maven:25-graalceThe default ENTRYPOINT is mvn. The working directory is /opt/app.
# Print Maven + Java versions
docker run --rm softinstigate/graalvm-maven --version
# Build a Maven project in the current directory
docker run -it --rm \
-v "$PWD":/opt/app \
-v "$HOME"/.m2:/root/.m2 \
softinstigate/graalvm-maven \
clean packageMounting
~/.m2speeds up builds by reusing your local Maven cache.
Use the GraalVM Native Build Tools (Maven plugin) in your project. Then run:
# Show native plugin help
docker run -it --rm -v "$PWD":/opt/app softinstigate/graalvm-maven native:help
# Typical native build (adjust for your project)
docker run -it --rm \
-v "$PWD":/opt/app \
-v "$HOME"/.m2:/root/.m2 \
softinstigate/graalvm-maven \
-Pnative -DskipTests native:compile# Build the image locally (no cache)
./bin/build.sh
# Test the image
docker run -it --rm softinstigate/graalvm-maven --version
# Optional: push :latest manually (CI handles official releases)
./bin/push.sh- GitHub Actions workflow:
.github/workflows/deploy-image.yml - Trigger: push of any git tag
- Output: multi-arch images pushed to Docker Hub and GHCR with:
latestand the exact git tag name
- Maintainer flow to release a new base version:
- Update
ARG JAVA_VERSIONandARG MAVEN_VERSIONinDockerfile - Update the versions in this README
- Commit and push, then create and push a git tag (e.g.
25-graalce)
- Update
- Entrypoint script:
bin/entrypoint.sh- Sources
/root/.bashrcto activate SDKMAN! before executing Maven - Executes
mvn "$@"
- Sources
- SDKMAN! config ensures non-interactive installs and stable tool versions:
sdkman_auto_answer=truesdkman_auto_selfupdate=falsesdkman_insecure_ssl=true
-
Maven not found when overriding entrypoint:
- If you replace the entrypoint with a shell, run
source ~/.bashrcbefore usingmvn.
docker run -it --rm --entrypoint bash softinstigate/graalvm-maven source ~/.bashrc && mvn -v
- If you replace the entrypoint with a shell, run
-
Slow builds or dependency downloads:
- Ensure you mount your local Maven cache:
-v "$HOME"/.m2:/root/.m2
- Ensure you mount your local Maven cache:
-
Verify SDKMAN!/Java/Maven inside the container:
docker run -it --rm --entrypoint bash softinstigate/graalvm-maven -lc \ 'source ~/.bashrc; sdk current; java -version; mvn -version'
This repository is licensed under the Apache License 2.0.