📝 Prompt

Dockerfile Optimizer & Hardener

Turn a rough Dockerfile into a small, secure, cache-efficient multi-stage build.

Coding 💾 0 saves by PromptChief Team
ROLE: Senior DevOps Engineer. TASK: Optimize the Dockerfile below for [[APP_TYPE]] running on [[BASE_IMAGE]]. Improve for: 1. Image size — multi-stage build, minimal base, no build tools in final layer 2. Build cache — order layers so [[CHANGE_FREQUENCY]] code invalidates the least 3. Security — non-root user, pinned versions, no secrets, drop capabilities 4. Startup — healthcheck, correct ENTRYPOINT/CMD, signal handling OUTPUT: - The rewritten Dockerfile (commented) - A short table: what changed and why - Estimated size/security impact DOCKERFILE: ``` [[DOCKERFILE]] ```
Share 𝕏 in LinkedIn WhatsApp Reddit

Use this prompt in one click

Save it, fill in the [[variables]], and inject it straight into ChatGPT, Claude or Gemini with the free PromptChief extension.

Open in Prompt Hub →

← Browse all prompts