Build fails with fs.read entitlement error when dockerfile is outside the build context (buildx >= 0.37.2)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- docker, docker-compose, go
- 領域
- build-system
調査の方向性
Start in pkg/compose/build_bake.go and inspect localBuildPaths, which currently grants fs.read access for build contexts but not the Dockerfile path. Reproduce with a Compose service whose Dockerfile is outside its build context, then check existing build-bake tests for coverage. Done means a local external Dockerfile is included in the fs.read allowlist while dockerfile_inline remains unaffected; an open linked pull request is already addressing this issue.
索引モデルが issue の本文から書いたものです。
説明
Description
Since buildx v0.37.2 (GHSA-gwr2-q96m-6682), buildx bake --progress rawjson enforces filesystem entitlements instead of skipping the consent check. Compose always invokes bake that way, but localBuildPaths in pkg/compose/build_bake.go only grants --allow fs.read= for build.context and build.additional_contexts — not for build.dockerfile. A service whose Dockerfile lives outside its build context therefore no longer builds. Before buildx v0.37.2 the missing grant went unnoticed because the check was skipped under rawjson.
This breaks every Dev Container that uses a Compose service with build:: the devcontainer CLI writes Dockerfile-with-features into a temp directory and points dockerfile: at it through an override file (dockerCompose.ts), which fails with:
additional privileges requested: pass "--allow=fs.read=/private/var/folders/…/T/devcontainercli/container-features/0.76.0-…/Dockerfile-with-features" to grant requested privileges
The code is unchanged in v5.6.0 and on main.
Steps To Reproduce
mkdir -p /tmp/outside && echo 'FROM alpine' > /tmp/outside/Dockerfile
mkdir -p /tmp/repro && cd /tmp/repro
cat > compose.yaml <<'EOF'
services:
app:
build:
context: .
dockerfile: /tmp/outside/Dockerfile
EOF
docker compose build
[+] Building 0.0s (1/1) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 466B 0.0s
[+] build 0/1
⠋ Image repro-app Building 0.1s
additional privileges requested: pass "--allow=fs.read=../outside/Dockerfile" to grant requested privileges
Compose Version
Docker Compose version v5.5.1
Docker Environment
macOS (Apple Silicon), Docker Desktop 4.94.0 (241994), buildx v0.37.2
Anything else?
Workaround: BUILDX_BAKE_ENTITLEMENTS_FS=0, which disables the check for all paths.
Suggested fix: add the resolved Dockerfile path to the fs.read allowlist when it is a local path outside the context (dockerfile_inline is unaffected).
- 主要言語
- Go
- スター
- 38.4k
- フォーク
- 5.9k
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 60
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/compose のほかの issue
-
Watch: exec mode対応中かも @glours が 1 日前に担当しました。 オープンkind/feature
docker/compose#14326 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
kind/feature
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
[BUG] `start -p <name>` treats an optional (`required: false`) dependency as required再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
-
[BUG] `mode` attribute in `configs` works but raises an unsupported warning対応中かも @ndeloof が 5 日前に担当しました。 オープンkind/bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
docker/compose#14288 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Warns about uid/gid, but with inline configs they do work対応中かも @ndeloof が 5 日前に担当しました。 オープンkind/bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
docker/compose#14283 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
Add Solentaオープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
slavakurilyak/awesome-ai-agents#760 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
agent-review-finding bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jordansmall/spindrift#5281 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
compiler-explorer/compiler-explorer#9272 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
github/github-mcp-server#3489 ·
メンテナーはふだん 4 日以内に返信