Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slimdock

CI License Crates.io

A CI-friendly Docker image analyzer. Inspect layers, detect waste, find secrets, and enforce best practices — all from the command line, no daemon required.

Install

cargo install slimdock

Or via install script:

curl -sSL https://raw.githubusercontent.com/user/slimdock/main/install.sh | sh

Quickstart

$ slimdock analyze nginx:latest

Image: nginx:latest
Size: 187 MB (compressed: 64 MB)
Layers: 7

Layer  Base Image          Size     Command
─────  ──────────────────  ───────  ──────────────────────────────
1      debian:bookworm     74.8 MB  apt-get update && apt-get install -y ...
2      (scratch)           2.1 MB   COPY nginx.conf /etc/nginx/
3      (scratch)           0.8 MB   COPY html/ /usr/share/nginx/html/
...

Waste: 12.4 MB (6.6%)
  - Build artifacts left in image: 8.2 MB
  - Unused dependencies: 4.2 MB

Commands

Command Description
analyze Full image analysis: layers, sizes, waste breakdown
waste Show only wasted space with cleanup suggestions
secrets Scan for leaked credentials, keys, and tokens
suggest Optimization recommendations for Dockerfile/labels
check CI gate — exit non-zero if issues are found

JSON Output

All commands support --format json for CI pipeline integration:

slimdock check myapp:latest --format json
{
  "image": "myapp:latest",
  "passed": false,
  "issues": [
    {"severity": "warn", "message": "Image has 3.2 MB of wasted space"},
    {"severity": "error", "message": "Hardcoded API key found in layer 2"}
  ]
}

Exit Codes

Code Meaning
0 Success
1 Error (invalid input, etc)
2 Check failed (issues found)

Comparison

Feature slimdock dive
Daemon required No Yes (Docker daemon)
CI-friendly ✅ exit codes + JSON ❌ TUI-only
JSON output
Exit codes for gates
Secret scanning
Multi-platform ✅ static binaries Docker image only
License MIT/Apache-2.0 MIT

License

Licensed under either of MIT or Apache 2.0 at your option.

About

Docker Image Layer Analyzer & Optimizer — Rust CLI tool for finding wasted space, leaked secrets, and Dockerfile inefficiencies. CI-friendly with JSON output and meaningful exit codes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages