Developer toolkit for Spring Boot containerization and benchmark-driven JVM tuning.
springdocker is a Python CLI that helps you inspect a Spring Boot project, generate a Dockerfile, create benchmark assets, run benchmark suites, and summarize benchmark results.
- Jib and Buildpacks optimize for build convenience and opaque image assembly.
- springdocker optimizes for teams that want a real Dockerfile they can own, read, and edit.
- It combines explicit Dockerfile generation with explainability and verification workflows.
See docs/POSITIONING.md for the detailed comparison and tradeoffs.
flowchart LR
dev[Developer] --> cli[springdocker CLI]
cli --> cfg[.springdocker.toml]
cli --> proj[Spring Boot project]
cli --> df[Generated Dockerfile]
cli --> bench[Benchmark variants + raw CSV]
bench --> report[Table / JSON analysis]
See docs/architecture.md for the detailed module map and command lifecycle.
The repo is split into these main surfaces:
src/springdocker/- installable CLI package and core implementation.cli/README.md- command reference and configuration details.
See Sample project map for which Spring Boot path to use.
- Detects Maven or Gradle projects.
- Writes a starter
.springdocker.tomlconfig. - Generates optimized Dockerfiles for the sample workflow.
- Pins generated base images by digest when known.
- Creates benchmark variants and runs benchmark suites.
- Summarizes benchmark CSV output as a table or JSON.
Digest update automation template: .github/renovate.json
| Path | Role | Use when |
|---|---|---|
examples/spring-boot-maven/ |
Human walkthrough (Maven) | Learning the CLI or trying Dockerfile generation |
examples/spring-boot-gradle/ |
Human walkthrough (Gradle) | Same, for Gradle projects |
tests/fixtures/{maven-only,gradle-only}/ |
CI golden samples | Running or extending automated tests (docs/golden-samples.md) |
samples/java-spring-docker/ |
Benchmark harness + evidence | Running benchmark scenarios and comparing raw.csv results |
Gradle walkthroughs use examples/spring-boot-gradle/ with the same commands below.
cd /path/to/your-repo
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install -e .
python3 -m pip install -e '.[benchmark]'
# Dockerfile workflow — start with examples/
springdocker doctor --project-root examples/spring-boot-maven
springdocker init --project-root examples/spring-boot-maven --build-tool maven
springdocker inspect --project-root examples/spring-boot-maven --format json
springdocker dockerfile generate --project-root examples/spring-boot-maven --output Dockerfile.generated --recipe jvm-balanced
springdocker explain --project-root examples/spring-boot-maven Dockerfile.generated --format json
springdocker verify --project-root examples/spring-boot-maven Dockerfile.generated
# Benchmark workflow — use the full sample app under samples/
springdocker benchmark generate --project-root samples/java-spring-docker --java-version 25
springdocker benchmark run --project-root samples/java-spring-docker --profile quick
springdocker benchmark analyze --project-root samples/java-spring-docker samples/java-spring-docker/benchmarks/04-custom-jre-jlink/results/raw.csv
springdocker benchmark compare --project-root samples/java-spring-docker samples/java-spring-docker/benchmarks/03-custom-jre-jlink/results/raw.csv --baseline-variant with-jlink-runtimedoctorchecks the project root and build tool.initwrites a starter config file.dockerfile generatewrites a Dockerfile to the requested path.benchmark generatecreates benchmark scenarios.benchmark runexecutes the benchmark runner.benchmark analyzeturnsraw.csvinto a table or JSON summary.
See cli/README.md for the command reference and config precedence rules.
See docs/benchmark-methodology.md for the benchmark model, run profiles, and summary calculations.
Benchmarks are an optional evidence subsystem and require benchmark extras (springdocker[benchmark]).
The sample project keeps benchmark scenarios under samples/java-spring-docker/benchmarks/.
Each scenario stores generated Dockerfiles and a results/raw.csv file so the output stays reproducible and easy to compare.
Versioned reference datasets are under samples/java-spring-docker/benchmarks/reference/.
Current reports focus on:
- image size
- build duration
- startup latency
- success rate
Benchmark summaries can be rendered as:
- terminal tables
- JSON
This repository currently targets:
- Python 3.10+ for the CLI
- Maven or Gradle Spring Boot projects
- Spring Boot 4.0.1 sample project
- Java 25 sample configuration
docs/architecture.mddocs/benchmark-methodology.mddocs/golden-samples.mddocs/extensions.mddocs/security-hardening.mddocs/observability.mddocs/kubernetes.mddocs/adr/README.mddocs/multiarch.mddocs/onboarding.mddocs/troubleshooting.mddocs/jvm-optimization.mdROADMAP.mdSECURITY.mdCONTRIBUTING.md
docs/example-gallery.mddocs/benchmark-dashboard.mddocs/native-image-roadmap.mddocs/distribution.mddocs/compatibility-matrix.md
| Tool | Focus | What springdocker adds |
|---|---|---|
| Jib | Dockerless image build | benchmark-aware Dockerfile and runtime tuning workflows |
| Buildpacks | Opinionated platform build | explicit Dockerfile generation and benchmark artifacts |
| Manual Dockerfiles | Full control | project detection, config, and repeatable benchmark analysis |
examples/README.md- walkthrough projects by build tooldocs/golden-samples.md- CI fixtures and variant coveragesamples/java-spring-docker/README.md- full benchmark sample appsamples/java-spring-docker/HELP.mdsamples/java-spring-docker/k8s/kustomization.yamlsamples/java-spring-docker/tools/README.md
The main package is under src/springdocker/. Run pytest, ruff check src tests, and mypy src before pushing changes.