{
    "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile",
    "locale": "en",
    "title": "Multi Stage Dockerfile | DeLaParra Services",
    "description": "'Create optimized multi-stage Dockerfiles for any language or framework'",
    "alternates": {
        "en": "https://delaparra-services.nl/skills/multi-stage-dockerfile",
        "nl": "https://delaparra-services.nl/nl/skills/multi-stage-dockerfile"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/skills/multi-stage-dockerfile.csv",
        "md": "https://delaparra-services.nl/skills/multi-stage-dockerfile.md",
        "json": "https://delaparra-services.nl/skills/multi-stage-dockerfile.json",
        "zip": "https://delaparra-services.nl/skills/multi-stage-dockerfile.zip",
        "pdf": "https://delaparra-services.nl/skills/multi-stage-dockerfile.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile.csv",
            "encodingFormat": "text/csv",
            "name": "multi-stage-dockerfile.csv"
        },
        {
            "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile.json",
            "encodingFormat": "application/json",
            "name": "multi-stage-dockerfile.json"
        },
        {
            "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile.md",
            "encodingFormat": "text/markdown",
            "name": "multi-stage-dockerfile.md"
        },
        {
            "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile.pdf",
            "encodingFormat": "application/pdf",
            "name": "multi-stage-dockerfile.pdf"
        },
        {
            "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile.zip",
            "encodingFormat": "application/zip",
            "name": "multi-stage-dockerfile.zip"
        },
        {
            "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile/download",
            "encodingFormat": "application/zip",
            "name": "multi-stage-dockerfile-files.zip"
        }
    ],
    "markdown": "# Multi Stage Dockerfile\n\n \n\n'Create optimized multi-stage Dockerfiles for any language or framework'\n\n \n\n**Licence** MIT\n\n \n\n**Source** github/awesome-copilot\n\n [Download zip](<https://delaparra-services.nl/skills/multi-stage-dockerfile/download>)   \n\nYour goal is to help me create efficient multi-stage Dockerfiles that follow best practices, resulting in smaller, more secure container images.\n\n \n\n## Multi-Stage Structure\n\n \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 \n\n## Base Images\n\n \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 \n\n## Layer Optimization\n\n \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 \n\n## Security Practices\n\n \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 \n\n## Performance Considerations\n\n \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\n\n \n\n## Files\n\n \n\n- ` LICENSE ` \n- ` SKILL.md ` \n- ` SOURCE.md `\n\n \n\n## Related terms\n\n \n\n- [ADD](<https://delaparra-services.nl/knowledge-hub/add>) \n- [ARG](<https://delaparra-services.nl/knowledge-hub/arg>) \n- [base image](<https://delaparra-services.nl/knowledge-hub/base-image>) \n- [build](<https://delaparra-services.nl/knowledge-hub/build>) \n- [CMD](<https://delaparra-services.nl/knowledge-hub/cmd>) \n- [COPY](<https://delaparra-services.nl/knowledge-hub/copy>) \n- [ENTRYPOINT](<https://delaparra-services.nl/knowledge-hub/entrypoint>) \n- [FROM](<https://delaparra-services.nl/knowledge-hub/from>) \n- [image](<https://delaparra-services.nl/knowledge-hub/image>) \n- [layer](<https://delaparra-services.nl/knowledge-hub/layer>) \n- [multi-stage build](<https://delaparra-services.nl/knowledge-hub/multi-stage-build>) \n- [USER](<https://delaparra-services.nl/knowledge-hub/user>) \n- [WORKDIR](<https://delaparra-services.nl/knowledge-hub/workdir>)\n\n \n\n[Installing an agent skill in Claude Code, Codex, Cursor and Copilot](<https://delaparra-services.nl/manuals/een-skill-installeren-in-je-ai-assistent>)\n\n[HTML version](https://delaparra-services.nl/skills/multi-stage-dockerfile)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://delaparra-services.nl/skills/multi-stage-dockerfile#webpage",
                "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile",
                "name": "Multi Stage Dockerfile | DeLaParra Services",
                "description": "'Create optimized multi-stage Dockerfiles for any language or framework'",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/skills/multi-stage-dockerfile#breadcrumb"
                }
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/skills/multi-stage-dockerfile#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Multi Stage Dockerfile"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "SoftwareSourceCode",
                "@id": "https://delaparra-services.nl/skills/multi-stage-dockerfile#skill",
                "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile",
                "name": "Multi Stage Dockerfile",
                "description": "'Create optimized multi-stage Dockerfiles for any language or framework'",
                "inLanguage": "en",
                "license": "https://spdx.org/licenses/MIT.html",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/skills/multi-stage-dockerfile#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/skills/multi-stage-dockerfile#dataset",
                "name": "Multi Stage Dockerfile",
                "description": "'Create optimized multi-stage Dockerfiles for any language or framework'",
                "url": "https://delaparra-services.nl/skills/multi-stage-dockerfile",
                "identifier": "https://delaparra-services.nl/skills/multi-stage-dockerfile#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/skills/multi-stage-dockerfile#skill"
                },
                "creditText": "github/awesome-copilot",
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://spdx.org/licenses/MIT.html",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "dateModified": "2026-11-28T14:00:12+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#skills",
                    "name": "Skills for AI coding assistants",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "multi-stage-dockerfile.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/skills/multi-stage-dockerfile.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:12+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "multi-stage-dockerfile.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/skills/multi-stage-dockerfile.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:12+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "multi-stage-dockerfile.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/skills/multi-stage-dockerfile.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:12+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "multi-stage-dockerfile.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/skills/multi-stage-dockerfile.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:12+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "multi-stage-dockerfile.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/multi-stage-dockerfile.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:12+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "multi-stage-dockerfile-files.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/multi-stage-dockerfile/download",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:12+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    }
                ]
            }
        ]
    }
}