build command: add support for --build-arg flag
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #143 来自 @OrtegaMatias —— 已关闭,未合并
评估
调研方向
The issue identifies the build subcommand and the underlying container build invocation, but gives no source or test file paths. Start by locating the build command’s option parsing and existing build invocation, then check how repeated options are covered in tests. Done means each supplied --build-arg KEY=VALUE reaches every service build; an open linked pull request indicates work is already underway.
由索引模型根据 Issue 内容生成。
描述
Summary
The build subcommand does not currently support the --build-arg flag, which is a standard part of docker compose build. Any project that relies on build-time arguments (e.g. for injecting private registry tokens or license keys into a multi-stage Dockerfile) cannot use container-compose build as a drop-in replacement today.
Current Behavior
Running the following command fails immediately with an unrecognized option error:
container-compose build \
--build-arg BO_NPM_PKG_AUTH_TOKEN=$BO_NPM_PKG_AUTH_TOKEN \
--build-arg FONTAWESOME_PRO_TOKEN=$FONTAWESOME_PRO_TOKEN \
--build-arg SIDEKIQ_KEY=$SIDEKIQ_KEY
Error: Unknown option '--build-arg'
Usage: container-compose <subcommand>
See 'container-compose --help' for more information.
Expected Behavior
Parity with docker compose build, which accepts one or more --build-arg KEY=VALUE pairs and forwards them to the underlying image build process as build-time variables. The equivalent native container build CLI also supports --build-arg, so this should be a straightforward passthrough.
# Should work the same as it does with docker compose
container-compose build \
--build-arg BO_NPM_PKG_AUTH_TOKEN=$BO_NPM_PKG_AUTH_TOKEN \
--build-arg FONTAWESOME_PRO_TOKEN=$FONTAWESOME_PRO_TOKEN \
--build-arg SIDEKIQ_KEY=$SIDEKIQ_KEY
Motivation / Use Case
Build args are essential for projects that need to inject secrets or configuration at image build time without baking them into the image or committing them to source control. Common real-world examples include:
- Private npm registry auth tokens (e.g. GitHub Packages, Artifactory)
- Font Awesome Pro license keys
- Private gem/package credentials (e.g. Sidekiq Pro)
- Any multi-stage Dockerfile that uses ARG to gate access to private dependencies
Without --build-arg support, teams adopting Apple Container via container-compose are blocked from migrating existing Docker-based CI/CD workflows that rely on this flag.
Proposed Implementation
The build command should be updated to:
Accept --build-arg as a repeatable option (i.e. it can be specified multiple times), taking a KEY=VALUE string each time.
For each service being built, pass each provided --build-arg value through to the underlying container build invocation via its own --build-arg flags.
References
docker compose build docs — --build-arg
container build CLI — already supports --build-arg
I appreciate all the work you've done on this project. 🍻
- 主要语言
- Swift
- 星标
- 1k
- 派生
- 61
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Mcrich23/Container-Compose 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
Mcrich23/Container-Compose#197 ·
维护者通常 1 天内回复
-
SIGINT/SIGTERM ignored during startup phase & healthcheck wait in foreground up可能已有人在做 @georgettica 于 27 天前认领。 未关闭
Mcrich23/Container-Compose#165 · 5 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
Mcrich23/Container-Compose#137 · 1 条评论 ·
维护者通常 1 天内回复
-
DecodingError.typeMismatch in build args可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
Mcrich23/Container-Compose#136 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
Containers launch sequentially - can they be launched concurrently?可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
Mcrich23/Container-Compose#128 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
查看 Mcrich23/Container-Compose 的全部 Issue
相似的 Issue
-
milestone-3
难度 2/5 1-3 小时 新手友好度 78/100
Harsha0912/recall#71 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
meshtastic/Meshtastic-Apple#3132 ·
维护者通常 1 天内回复
-
approved
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 66/100
MonitorControl/MonitorControl#1949 ·
-
Bug
难度 1/5 1 小时以内 新手友好度 91/100