A sample project to publish a Spring Native docker image with a GitHub action.
- Java 17
- Spring Boot 3
Dockerfile best-practices:
- Minimal packages
- Separate user
- Fixed versions
- Health-checks
Best-practice and Vulnerability scans provided by Azure/container-scan
ghcr.io/swissbuechi/spring-native-demo:latest
Built with eclipse-temurin
JVM to minimize RAM usage
ghcr.io/swissbuechi/spring-native-demo:native
- Docker
- Download
compose.yml
file - Run
docker compose up
Ubuntu
- Download Artifact
chmod +x ./<app>
./<app> -Dspring.config.location=<path to application.properties>
http://localhost:8080
http://localhost:8081
- Startup: 0.059s
- RAM: ~28MB
- Image size: 76 MB
- Startup: 1.964s
- RAM: ~80MB
- Image size: 201 MB