Buildah
$ buildah 官方出品 中风险Buildah(buildah)无需后台守护进程即可在 Linux 上构建 OCI 与 Docker 镜像。它同时支持标准 Dockerfile(buildah bud)和命令式分步组装(from、run、commit),并通过 buildah inspect 原生输出 JSON 元数据。
https://github.com/containers/buildah/blob/main/install.md buildah 直接在构建机 Linux containers/storage 与用户命名空间内运行,不适用 MCP。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
images/containers 支持 --json 且 buildah inspect 输出 JSON,但 bud 与 push 缺少 --dry-run。
buildah images --jsonandbuildah inspectemit JSON- Non-interactive Cobra CLI flags
在 Linux 上支持无守护进程与无 root 构建,避免暴露高权限 Docker 引擎,但构建过程会执行 Containerfile 中的指令。
- No persistent root daemon required when configured with
subuid/subgid - No
--dry-runpreview onbudorpush
仅原生支持 Linux(依赖内核命名空间、overlayfs 与 subuid/subgid),无原生 macOS 或 Windows 版本。
- Requires Linux kernel namespaces; macOS/Windows users must run inside a Linux VM
非常适合在 Kubernetes/OpenShift CI 容器内无守护进程构建极简镜像。
- Supports both
Containerfile/Dockerfile(bud) andfrom/copy/commitscripting
由 Containers 组织(containers/buildah)以 Apache-2.0 协议维护。
- Official
containers/buildahrepository
GitHub 上提供完整的 man 手册,但无 root 存储排障与发行版强相关。
- Manpages at github.com/containers/buildah/tree/main/docs
安全边界、鉴权与放权指南
读取 ${XDG_RUNTIME_DIR}/containers/auth.json 或 ~/.docker/config.json 中的镜像仓库鉴权凭证。
Apache-2.0 协议 100% 开源免费。
# Buildah Agent Rules - Use `buildah images --json` and `buildah inspect` for local read-only checks. - Remember `buildah` is Linux-native and requires user-namespace (`subuid`/`subgid`) support when rootless. - Never run `buildah rmi --all` or `buildah push` without explicit confirmation.
Agent 高频安全命令配方
只读查询(安全推荐)
buildah images --json
以结构化 JSON 返回本地存储的镜像 ID、标签与体积。
buildah inspect --type image alpine:latest
从本地存储打印完整的 OCI 镜像清单与配置 JSON。
受控写入与预演
buildah bud --platform linux/amd64 -t localhost/app:dev .
将镜像构建至本地 containers/storage,不推送到远端仓库。
核心优势
- + 无守护进程 OCI 构建,非常适合受限 Linux CI Pod 环境。
- +
buildah images --json与buildah inspect提供结构化本地镜像信息。 - + 同时支持
Dockerfile/Containerfile与命令式分步构建。
注意事项与踩坑点
- ! 仅原生支持 Linux,macOS 或 Windows 需依托 Linux 虚拟机运行。
- ! 无 root 模式依赖宿主机的
subuid/subgid与fuse-overlayfs正确配置。