Dockerfile Review and Optimisation
By Sophie Martin · Published · Updated
Paste it in. Get it smaller, faster, and not running as root.
Tags: Engineering, Technical, Coding
Prompt template
``` [textarea: Paste your Dockerfile] ``` App: [textarea: Language, framework, what it does] Current image size and build time: [text: Both] Runs on: [dropdown: Kubernetes, ECS, Cloud Run, Docker Compose, Local only] Built: [dropdown: Every commit, Daily, On release, Rarely] Review layer ordering and caching first, since most slow builds are one line invalidating the cache too early. Tell me whether multi-stage would help here. Flag the security problems: running as root, secrets baked into layers, unpinned base images. Give me the rewritten file with a comment on each change, an estimate of the size and time saved, and anything where I would be trading build speed against image size.