Build fails with fs.read entitlement error when dockerfile is outside the build context (buildx >= 0.37.2)
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- docker, docker-compose, go
- Área
- build-system
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- Go
- Estrellas
- 38.4k
- Forks
- 5.9k
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 60
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de docker/compose
-
Watch: exec modePosiblemente ocupada @glours la tomó hace 1 día. Abiertokind/feature
docker/compose#14326 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
kind/feature
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
[BUG] `start -p <name>` treats an optional (`required: false`) dependency as requiredQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 22/100
Los mantenedores suelen responder en 1 día
-
[BUG] `mode` attribute in `configs` works but raises an unsupported warningPosiblemente ocupada @ndeloof la tomó hace 5 días. Abiertokind/bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
docker/compose#14288 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] Warns about uid/gid, but with inline configs they do workPosiblemente ocupada @ndeloof la tomó hace 5 días. Abiertokind/bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
docker/compose#14283 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de docker/compose
Issues similares
-
Add SolentaAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
slavakurilyak/awesome-ai-agents#760 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
agent-review-finding bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
jordansmall/spindrift#5281 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
compiler-explorer/compiler-explorer#9272 ·
Los mantenedores suelen responder en 1 día
-
Integer parameters equal to 2^63 pass the range check in toInt and wrap to a negative numberAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
github/github-mcp-server#3489 ·
Los mantenedores suelen responder en 4 días