Evolve better Dockerfiles.
npx dockergenome optimizeDockerfiles tend to accrete over time: extra layers, expensive cache misses, oversized base images, and package-manager leftovers. dockergenome treats your Dockerfile like a genome:
- analyze the source
- create safe variants
- build them with Docker
- measure real outcomes
- keep the best-performing result
The result is a smaller, cleaner Dockerfile without overwriting your original.
- Automatic Dockerfile analysis — base image, layers, install commands, cache behavior, image-size risks
- Evolutionary optimization — image swaps, layer merging, cleanup insertion, dependency-copy reordering
- Real benchmarking — actual
docker buildtiming, image inspection, failure handling - Terminal-first UX — neon banner, spinners, mutation logs, leaderboard output
- Safe by default — original Dockerfile backup, no destructive overwrite, failed variants discarded
- Portfolio-ready artifacts — optimized Dockerfile, markdown report, and web landing page
npm install -g dockergenomeOr run directly:
npx dockergenome optimizedockergenome analyze
dockergenome benchmark
dockergenome evolve
dockergenome compare
dockergenome optimize| Command | Purpose |
|---|---|
analyze |
Scan the current Dockerfile and surface risks |
benchmark |
Build and score the current Dockerfile |
evolve |
Generate and benchmark multiple candidate genomes |
compare |
Compare Dockerfile with Dockerfile.optimized |
optimize |
Run the full pipeline and write final artifacts |
◈ Genome scan complete
Base image: node:20
Layers: 3
RUN instructions: 2
COPY instructions: 1
Score: 64/100
◈ Evolution leaderboard
Variant Status Time Size Layers Score
-----------------------------------------------------------
g1-v2 PASS 23104 212.40MB 2 550.72
seed PASS 24780 382.81MB 3 205.18
Dockerfile.optimizedgenome-report.mdbenchmark-summary.jsonDockerfile.backup
flowchart LR
A["CLI"] --> B["Analyzer"]
A --> C["Evolution Engine"]
C --> D["Mutator"]
C --> E["Benchmark Runner"]
E --> F["Docker CLI"]
C --> G["Leaderboard"]
G --> H["Markdown Report"]
dockergenome intentionally uses conservative mutations:
- swap known large base images for slim equivalents
- merge
RUNlayers where safe - add package-manager cache cleanup
- split dependency-manifest copies from application copies to improve cache reuse
Each candidate is built in isolation. Failed builds are preserved in the leaderboard as failed experiments, but they are never selected as the winning genome.
Add terminal captures here after your first real benchmark run.
docs/screenshots/leaderboard.pngdocs/screenshots/report.pngdocs/screenshots/landing-page.png
npm install
npm run build
npm run dev -- optimize- configurable mutation strategies
- support for multi-objective scoring profiles
- Docker BuildKit cache metrics
- runtime benchmark hooks
- richer diff output between candidate genomes
- OCI registry publishing workflows
- LLM-assisted mutation proposals
- historical learning from previous runs
- workload-aware optimization profiles
- autonomous remediation suggestions for build failures
MIT