---
name: docker-multi-stage-builder
description: "Create optimized, small-footprint Dockerfiles using multi-stage builds. Use when the user wants help with Docker Multi-stage Builder. Related topics: coding, devops, docker."
---

# Docker Multi-stage Builder

Create optimized, small-footprint Dockerfiles using multi-stage builds.

## How to use this skill

1. Ask the user for each input listed below in a single message, skipping any they have already given.
2. Where options are listed, offer them, but accept other answers too.
3. Fill the answers into the prompt template, then follow the completed prompt to produce the result.

## Inputs

- **Language / Platform** (choose one: Node.js, Go, Python, Java, Rust, Flutter Web, .NET)
- **Package Manager** (choose one: npm, yarn, pnpm, go mod, pip, maven, gradle, cargo)
- **Port to expose** (free text, e.g. "")
- **Use alpine/slim base images** (choose one: Yes, No)
- **Enable non-root user execution** (choose one: Yes, No)
- **Environment** (choose one: Development, Production, Testing)

## Prompt template

## Introduction
Generate a lightweight, secure multi-stage Dockerfile for your application.

## Application details
- Language / Platform: {{Language / Platform}}
- Package Manager: {{Package Manager}}
- Port to expose: {{Port to expose}}

## Optimization Settings
- Use alpine/slim base images: {{Use alpine/slim base images}}
- Enable non-root user execution: {{Enable non-root user execution}}
- Environment: {{Environment}}

---

Source: [Docker Multi-stage Builder on PromptBuild](https://promptbuild.io/prompt/1DdufErJdDIvOUIojk8r/docker-multi-stage-builder)
