·create-multistage-dockerfile
</>

create-multistage-dockerfile

创建多阶段 Dockerfile,将构建和运行时环境分开,以实现最少的生产映像。涵盖构建器/运行时阶段分离、工件复制、暂存/distroless/alpine 目标以及大小比较。当生产映像太大、当构建工具包含在最终映像中、当您需要从一个 Dockerfile 中分离开发和生产映像时,或者当部署到边缘或无服务器等受限环境时,请使用。

10安装·1热度·@pjt222

安装

$npx skills add https://github.com/pjt222/development-guides --skill create-multistage-dockerfile

如何安装 create-multistage-dockerfile

通过命令行快速安装 create-multistage-dockerfile AI 技能到你的开发环境

  1. 打开终端: 打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 运行安装命令: 复制并运行以下命令:npx skills add https://github.com/pjt222/development-guides --skill create-multistage-dockerfile
  3. 验证安装: 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

来源:pjt222/development-guides。

SKILL.md

查看原文

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
分类
</>开发工具
认证
收录时间
2026-03-10
更新时间
2026-03-10

Browse more skills from pjt222/development-guides

快速解答

什么是 create-multistage-dockerfile?

创建多阶段 Dockerfile,将构建和运行时环境分开,以实现最少的生产映像。涵盖构建器/运行时阶段分离、工件复制、暂存/distroless/alpine 目标以及大小比较。当生产映像太大、当构建工具包含在最终映像中、当您需要从一个 Dockerfile 中分离开发和生产映像时,或者当部署到边缘或无服务器等受限环境时,请使用。 来源:pjt222/development-guides。

如何安装 create-multistage-dockerfile?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/pjt222/development-guides --skill create-multistage-dockerfile 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

这个 Skill 的源码在哪?

https://github.com/pjt222/development-guides