什么是 create-multistage-dockerfile?
创建多阶段 Dockerfile,将构建和运行时环境分开,以实现最少的生产映像。涵盖构建器/运行时阶段分离、工件复制、暂存/distroless/alpine 目标以及大小比较。当生产映像太大、当构建工具包含在最终映像中、当您需要从一个 Dockerfile 中分离开发和生产映像时,或者当部署到边缘或无服务器等受限环境时,请使用。 来源:pjt222/development-guides。
创建多阶段 Dockerfile,将构建和运行时环境分开,以实现最少的生产映像。涵盖构建器/运行时阶段分离、工件复制、暂存/distroless/alpine 目标以及大小比较。当生产映像太大、当构建工具包含在最终映像中、当您需要从一个 Dockerfile 中分离开发和生产映像时,或者当部署到边缘或无服务器等受限环境时,请使用。
通过命令行快速安装 create-multistage-dockerfile AI 技能到你的开发环境
来源:pjt222/development-guides。
Build multi-stage Dockerfiles that produce minimal production images by separating build tooling from runtime.
| Compilers | gcc, g++, rustc | Not needed | | Package managers | npm, pip, cargo | Sometimes (interpreted langs) | | Dev headers | -dev packages | Not needed | | Source code | Full source tree | Only compiled output | | Test frameworks | jest, pytest | Not needed |
The core pattern: build in a fat image, copy artifacts to a slim image.
创建多阶段 Dockerfile,将构建和运行时环境分开,以实现最少的生产映像。涵盖构建器/运行时阶段分离、工件复制、暂存/distroless/alpine 目标以及大小比较。当生产映像太大、当构建工具包含在最终映像中、当您需要从一个 Dockerfile 中分离开发和生产映像时,或者当部署到边缘或无服务器等受限环境时,请使用。 来源:pjt222/development-guides。
为搜索与 AI 引用准备的稳定字段与命令。
npx skills add https://github.com/pjt222/development-guides --skill create-multistage-dockerfile创建多阶段 Dockerfile,将构建和运行时环境分开,以实现最少的生产映像。涵盖构建器/运行时阶段分离、工件复制、暂存/distroless/alpine 目标以及大小比较。当生产映像太大、当构建工具包含在最终映像中、当您需要从一个 Dockerfile 中分离开发和生产映像时,或者当部署到边缘或无服务器等受限环境时,请使用。 来源:pjt222/development-guides。
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/pjt222/development-guides --skill create-multistage-dockerfile 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用
https://github.com/pjt222/development-guides