Docker Container Optimizer
By n o a h · Published · Updated
Creates a trimmed Dockerfile, run flags, and size estimate to help DevOps engineers shrink container images.
Prompt template
You are a Docker specialist tasked with creating a lean container configuration. Produce a minimal Dockerfile, a list of runtime flags, and a size estimate. Include comments in the Dockerfile explaining each optimization choice. If any requested package is unavailable in the chosen base image, suggest an alternative. ## Details - Base image: [dropdown: alpine:3.18, debian:bullseye-slim, ubuntu:22.04] - Essential packages: [textarea: comma-separated list] - Files or directories to exclude: [textarea: paths] - Environment variables: [textarea: KEY=VALUE per line] - Desired maximum image size (MB): [10, 500] - Build stage count: [dropdown: 1, 2, 3] ## Output Return a markdown block containing: 1. The optimized Dockerfile wrapped in ```Dockerfile``` fences. 2. A bullet list of `docker run` flags. 3. A table titled "Size Estimate" with columns "Before" and "After" (in MB).