{"id":"a7d31866-a55a-474d-9599-efedc9f365a4","shortId":"zRfxxz","kind":"skill","title":"multi-stage-dockerfile","tagline":"Create optimized multi-stage Dockerfiles for any language or framework","description":"Your goal is to help me create efficient multi-stage Dockerfiles that follow best practices, resulting in smaller, more secure container images.\n\n## Multi-Stage Structure\n\n- Use a builder stage for compilation, dependency installation, and other build-time operations\n- Use a separate runtime stage that only includes what's needed to run the application\n- Copy only the necessary artifacts from the builder stage to the runtime stage\n- Use meaningful stage names with the `AS` keyword (e.g., `FROM node:18 AS builder`)\n- Place stages in logical order: dependencies → build → test → runtime\n\n## Base Images\n\n- Start with official, minimal base images when possible\n- Specify exact version tags to ensure reproducible builds (e.g., `python:3.11-slim` not just `python`)\n- Consider distroless images for runtime stages where appropriate\n- Use Alpine-based images for smaller footprints when compatible with your application\n- Ensure the runtime image has the minimal necessary dependencies\n\n## Layer Optimization\n\n- Organize commands to maximize layer caching\n- Place commands that change frequently (like code changes) after commands that change less frequently (like dependency installation)\n- Use `.dockerignore` to prevent unnecessary files from being included in the build context\n- Combine related RUN commands with `&&` to reduce layer count\n- Consider using COPY --chown to set permissions in one step\n\n## Security Practices\n\n- Avoid running containers as root - use `USER` instruction to specify a non-root user\n- Remove build tools and unnecessary packages from the final image\n- Scan the final image for vulnerabilities\n- Set restrictive file permissions\n- Use multi-stage builds to avoid including build secrets in the final image\n\n## Performance Considerations\n\n- Use build arguments for configuration that might change between environments\n- Leverage build cache efficiently by ordering layers from least to most frequently changing\n- Consider parallelization in build steps when possible\n- Set appropriate environment variables like NODE_ENV=production to optimize runtime behavior\n- Use appropriate healthchecks for the application type with the HEALTHCHECK instruction","tags":["multi","stage","dockerfile","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"capabilities":["skill","source-github","skill-multi-stage-dockerfile","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/multi-stage-dockerfile","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (2,183 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:17.888Z","embedding":null,"createdAt":"2026-04-18T20:24:47.042Z","updatedAt":"2026-05-18T18:52:17.888Z","lastSeenAt":"2026-05-18T18:52:17.888Z","tsv":"'18':96 '3.11':128 'alpin':143 'alpine-bas':142 'applic':71,153,320 'appropri':140,304,316 'argument':275 'artifact':76 'avoid':222,263 'base':108,114,144 'behavior':314 'best':30 'build':54,105,125,199,238,261,265,274,284,299 'build-tim':53 'builder':45,79,98 'cach':170,285 'chang':174,178,182,280,295 'chown':213 'code':177 'combin':201 'command':166,172,180,204 'compat':150 'compil':48 'configur':277 'consid':133,210,296 'consider':272 'contain':37,224 'context':200 'copi':72,212 'count':209 'creat':5,22 'depend':49,104,162,186 'distroless':134 'dockerfil':4,10,27 'dockerignor':189 'e.g':93,126 'effici':23,286 'ensur':123,154 'env':309 'environ':282,305 'exact':119 'file':193,255 'final':245,249,269 'follow':29 'footprint':148 'framework':15 'frequent':175,184,294 'goal':17 'healthcheck':317,324 'help':20 'imag':38,109,115,135,145,157,246,250,270 'includ':64,196,264 'instal':50,187 'instruct':229,325 'keyword':92 'languag':13 'layer':163,169,208,289 'least':291 'less':183 'leverag':283 'like':176,185,307 'logic':102 'maxim':168 'meaning':86 'might':279 'minim':113,160 'multi':2,8,25,40,259 'multi-stag':7,24,39,258 'multi-stage-dockerfil':1 'name':88 'necessari':75,161 'need':67 'node':95,308 'non':234 'non-root':233 'offici':112 'one':218 'oper':56 'optim':6,164,312 'order':103,288 'organ':165 'packag':242 'parallel':297 'perform':271 'permiss':216,256 'place':99,171 'possibl':117,302 'practic':31,221 'prevent':191 'product':310 'python':127,132 'reduc':207 'relat':202 'remov':237 'reproduc':124 'restrict':254 'result':32 'root':226,235 'run':69,203,223 'runtim':60,83,107,137,156,313 'scan':247 'secret':266 'secur':36,220 'separ':59 'set':215,253,303 'skill' 'skill-multi-stage-dockerfile' 'slim':129 'smaller':34,147 'source-github' 'specifi':118,231 'stage':3,9,26,41,46,61,80,84,87,100,138,260 'start':110 'step':219,300 'structur':42 'tag':121 'test':106 'time':55 'tool':239 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'type':321 'unnecessari':192,241 'use':43,57,85,141,188,211,227,257,273,315 'user':228,236 'variabl':306 'version':120 'vulner':252","prices":[{"id":"64b12fe6-f21e-4950-a4ff-9e193746e6e4","listingId":"a7d31866-a55a-474d-9599-efedc9f365a4","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:24:47.042Z"}],"sources":[{"listingId":"a7d31866-a55a-474d-9599-efedc9f365a4","source":"github","sourceId":"github/awesome-copilot/multi-stage-dockerfile","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/multi-stage-dockerfile","isPrimary":false,"firstSeenAt":"2026-04-18T21:50:17.842Z","lastSeenAt":"2026-05-18T18:52:17.888Z"},{"listingId":"a7d31866-a55a-474d-9599-efedc9f365a4","source":"skills_sh","sourceId":"github/awesome-copilot/multi-stage-dockerfile","sourceUrl":"https://skills.sh/github/awesome-copilot/multi-stage-dockerfile","isPrimary":true,"firstSeenAt":"2026-04-18T20:24:47.042Z","lastSeenAt":"2026-05-07T22:40:15.413Z"}],"details":{"listingId":"a7d31866-a55a-474d-9599-efedc9f365a4","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"multi-stage-dockerfile","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"704382de43e25d889c671455cda076d0d28e71e5","skill_md_path":"skills/multi-stage-dockerfile/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/multi-stage-dockerfile"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"multi-stage-dockerfile","description":"Create optimized multi-stage Dockerfiles for any language or framework"},"skills_sh_url":"https://skills.sh/github/awesome-copilot/multi-stage-dockerfile"},"updatedAt":"2026-05-18T18:52:17.888Z"}}