{"id":"a7d31866-a55a-474d-9599-efedc9f365a4","shortId":"zRfxxz","kind":"skill","title":"Multi Stage Dockerfile","tagline":"Awesome Copilot skill by Github","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"],"capabilities":["skill","source-github","category-awesome-copilot"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/multi-stage-dockerfile","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","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:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T19:40:25.056Z","embedding":null,"createdAt":"2026-04-18T20:24:47.042Z","updatedAt":"2026-04-22T19:40:25.056Z","lastSeenAt":"2026-04-22T19:40:25.056Z","tsv":"'18':89 '3.11':121 'alpin':136 'alpine-bas':135 'applic':64,146,313 'appropri':133,297,309 'argument':268 'artifact':69 'avoid':215,256 'awesom':4 'base':101,107,137 'behavior':307 'best':23 'build':47,98,118,192,231,254,258,267,277,292 'build-tim':46 'builder':38,72,91 'cach':163,278 'category-awesome-copilot' 'chang':167,171,175,273,288 'chown':206 'code':170 'combin':194 'command':159,165,173,197 'compat':143 'compil':41 'configur':270 'consid':126,203,289 'consider':265 'contain':30,217 'context':193 'copi':65,205 'copilot':5 'count':202 'creat':15 'depend':42,97,155,179 'distroless':127 'dockerfil':3,20 'dockerignor':182 'e.g':86,119 'effici':16,279 'ensur':116,147 'env':302 'environ':275,298 'exact':112 'file':186,248 'final':238,242,262 'follow':22 'footprint':141 'frequent':168,177,287 'github':8 'goal':10 'healthcheck':310,317 'help':13 'imag':31,102,108,128,138,150,239,243,263 'includ':57,189,257 'instal':43,180 'instruct':222,318 'keyword':85 'layer':156,162,201,282 'least':284 'less':176 'leverag':276 'like':169,178,300 'logic':95 'maxim':161 'meaning':79 'might':272 'minim':106,153 'multi':1,18,33,252 'multi-stag':17,32,251 'name':81 'necessari':68,154 'need':60 'node':88,301 'non':227 'non-root':226 'offici':105 'one':211 'oper':49 'optim':157,305 'order':96,281 'organ':158 'packag':235 'parallel':290 'perform':264 'permiss':209,249 'place':92,164 'possibl':110,295 'practic':24,214 'prevent':184 'product':303 'python':120,125 'reduc':200 'relat':195 'remov':230 'reproduc':117 'restrict':247 'result':25 'root':219,228 'run':62,196,216 'runtim':53,76,100,130,149,306 'scan':240 'secret':259 'secur':29,213 'separ':52 'set':208,246,296 'skill':6 'slim':122 'smaller':27,140 'source-github' 'specifi':111,224 'stage':2,19,34,39,54,73,77,80,93,131,253 'start':103 'step':212,293 'structur':35 'tag':114 'test':99 'time':48 'tool':232 'type':314 'unnecessari':185,234 'use':36,50,78,134,181,204,220,250,266,308 'user':221,229 'variabl':299 'version':113 'vulner':245","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-04-22T18:53:00.359Z"},{"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-04-22T19:40:25.056Z"}],"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","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/multi-stage-dockerfile"},"updatedAt":"2026-04-22T19:40:25.056Z"}}