Container Diet
Slim down your Docker images with AI-powered sass. ๐ณ๐
About Container Diet
Reviews 9
-
Wiley Lubowitz 9 months ago
Hey hunters! ๐ Since the initial launch of Container Diet, the CLI has gone through a serious evolution. Here's everything that shipped since v0.1.0: ๐ ๏ธ --auto-fix โ The killer feature Stop reading advice and start applying it. Pass --auto-fix and the Container Dietician writes you a complete, optimized Dockerfile.diet on the spot โ works even without a source Dockerfile by reverse-engineering your image layers. container-diet analyze --dockerfile Dockerfile --auto-fix # โ Writes Dockerfile.diet with all fixes applied ๐ --remote & --pull-missing Analyze any image, anywhere. --remote pulls straight from a registry without needing a local copy. --pull-missing keeps local-first behavior but auto-pulls if the image isn't found locally. container-diet analyze python:3.11-slim --remote container-diet analyze busybox --pull-missing ๐จ Colorful, structured CLI output The terminal output was completely redesigned โ Docker-brand cyan/magenta/green color coding, emoji status indicators (โ, โ, โ ), neon section headers, and a tabular layer-by-layer size breakdown. --help now renders a fully styled, structured template instead of the default Cobra output. ๐ง Smarter AI analysis (v0.1.1 โ v0.3.0) - Added package manager cache advice โ the AI now specifically calls out un-cleared apt, pip, and npm caches that silently bloat your layers - Switched to a structured JSON response (AnalysisResponse) so advice and auto-fix content are cleanly separated and reliably parsed - AI client hardened with a 90-second timeout, context-based request cancellation, and proper type-safe API response parsing โ๏ธ Analyzer & internals refactored Removed the old CheckDaemon pre-flight check, collapsed layer metadata collection into a single efficient pass, and wired in the pullMissing parameter for clean remote-fallback control โ no dead code, no unnecessary os/exec calls. Full CLI feature surface: - ๐ง GPT-4o Analysis โ context-aware roasts _and_ actionable optimization tips - ๐ ๏ธ --auto-fix โ generates a ready-to-use Dockerfile.diet with all fixes applied - ๐ --remote โ analyze any public registry image without a local daemon copy - ๐ --pull-missing โ local-first with automatic remote fallback - ๐ก๏ธ Security Audits โ root users, exposed secrets, chmod 777 caught and called out - ๐จ Beautiful CLI output โ Docker-brand colors, tabular layer analysis, neon section headers - ๐ --dockerfile โ pass your Dockerfile for richer, more targeted AI advice - ๐ค --model โ swap in any OpenAI model (defaults to gpt-4o) The biggest thing I shipped since launch is --auto-fix. I got tired of reading optimization advice and then having to manually apply it โ so I made the AI just write the fixed Dockerfile for you. It reverse-engineers your image layers if you don't even have a Dockerfile handy. The CLI output also got a full makeover with colors, emojis, and structured sections so it actually feels good to use in the terminal. Would love to hear what you think โ and what you'd want next (TUI mode? CI integration? Drop it in the comments)!" Links: - ๐ Repo: https://github.com/k1lgor/container-diet - ๐ Web: https://k1lgor.github.io/container-diet/ - ๐ฆ Install: go install github.com/k1lgor/container-diet/cmd/cli@latest
-
Karley Frami 1 year ago
Great automation. Congratulations on the launch!
-
Buck Yundt 1 year ago
Can we not use other AIs for the same? Can Container Diet generate images?
-
Ulises Ankunding 1 year ago
Lmao I love the subtitle ๐
-
Joaquin Wisozk 1 year ago
@k1lgor Love this, making Docker optimisation fun is such a clever angle. Curious: does Container Diet just analyze the final image, or can it actually suggest alternative base images / multi-stage setups too? Thatโs where most peopleโs โcontainer caloriesโ come from.
-
Toni Kutch 1 year ago
lol @ "why is this 2GB?" felt. The sassy dietician vibe might actually make me fix stuff instead of shrugging. Love that it's local-only. Curious if it groks multi-stage builds and package manager caches (pip/npm). Tossing it at a chunky image later.
-
Kyleigh Luettgen 1 year ago
Nice, Was looking for something like that. Will try this.
-
Gaylord Buckridge 1 year ago
Congratulations on launching Container Diet! AI-driven, context-aware optimization plus security auditing makes it a thoughtful tool for developers looking to streamline their Docker images.
-
Wiley Lubowitz 1 year ago
Great ideia! Question, how does is this different from asking Claude or Any model directly? Do have a huge set of rules that you consider best practices? Congrats on the launch