buildMountOptions warns "should not define `bind` option" for named volumes carrying only an SELinux relabel flag, which compose itself consumes
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 62/100
Línea de trabajo
Empieza en buildMountOptions(), donde se dispara la advertencia cuando un mount tiene tipo volume y un Bind no nil. Revisa cómo buildContainerVolumes() y toBindString() usan v.Bind.SELinux para los volúmenes con nombre, de modo que la advertencia solo omita el caso en que Bind establece únicamente SELinux. Mantén la advertencia para otros campos de Bind como propagation y create_host_path. Está terminado cuando un mount z/Z de un volumen con nombre no produce advertencia y un mount de volumen con otros campos de Bind sigue advirtiendo, lo que cubren las pruebas de buildMountOptions.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
A named-volume mount written with the documented short syntax vol:/path:z
canonicalises to type: volume + bind: {selinux: z}; bind.selinux is the
compose model's only slot for a relabel flag (volume: {selinux: z} is a schema
error, so there is no long-syntax alternative). buildMountOptions() then warns
unconditionally on volume.Type != VolumeTypeBind && volume.Bind != nil,
so every such mount emits a warning on every container create.
The warning is a false positive here, because compose itself consumes the
option it is warning about: two functions later buildContainerVolumes()
routes plain named-volume mounts through the legacy HostConfig.Binds string
API via toBindString(), which appends v.Bind.SELinux (the modern Mounts
API cannot express relabels). Support for bind.selinux on named volumes was
added deliberately in compose-spec/compose-go#213 (fixing #9072, where the
flags were silently dropped). So the configuration is correct, compose honours
it, and the user is told it is wrong.
Steps to reproduce
services:
probe:
image: busybox:latest
command: ["true"]
volumes:
- probevol:/data:z,rw
volumes:
probevol:
docker compose up prints, once per z/Z-flagged named-volume mount per create:
time="..." level=warning msg="mount of type `volume` should not define `bind` option"
docker inspect confirms the flag was honoured:
Binds: ["proj_probevol:/data:rw,z"].
Expected
No warning when the bind: struct on a type: volume mount sets only
selinux, since that field is both the sole supported spelling and one compose
acts on. A bind: struct setting other fields (propagation,
create_host_path) on a volume mount should keep warning.
Impact
On SELinux-enforcing hosts the flags are load-bearing, so the warning cannot be
avoided by dropping them, and --log-level error suppresses all warnings rather
than this one. Deployment tooling ends up filtering the line out of compose's
stderr. It also breaks machine-readable output for downstream consumers:
ansible-collections/community.docker#846 is the same line failing an event
parser.
Versions
Reproduced on Compose v5.1.3 / Engine 29.4.1 (2026-07-19) and Compose v5.5.0 /
Engine 29.7.2 (2026-09-06). buildMountOptions() on main is unchanged.
- Lenguaje dominante
- Go
- Estrellas
- 38.9k
- Forks
- 6k
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 81
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
-
[BUG] `docker compose port` prints `:0` (exit 0) for a port the image exposes but the service does not publishPosiblemente ocupada @ndeloof la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[BUG] deploy.restart_policy without condition drops the restart policyQuizá libre de nuevo @akshat-lakhera la tomó hace 25 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
docker/compose#14383 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] up: an optional (required: false) service_healthy dependent is not started when a required dependent shares the failing waitPosiblemente ocupada @ndeloof la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
docker/compose#14507 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] Negative replica count in scale flags (docker compose scale / --scale) is accepted without validationPosiblemente ocupada @arsalanyavari la tomó hace 8 días. Abiertokind/bug status/approved
Dificultad 2/5 1-3 horas Aptitud para principiantes 30/100
Los mantenedores suelen responder en 1 día
-
[BUG] pre_stop hooks are skipped when up or scale stops a containerPosiblemente ocupada @htoyoda18 la tomó hace 11 días. Abiertokind/bug status/approved
Dificultad 4/5 3-5 días Aptitud para principiantes 53/100
Los mantenedores suelen responder en 1 día
Todos los issues de docker/compose
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
fluxcd/notification-controller#1441 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
OneBusAway/maglev#2145 ·
Los mantenedores suelen responder en 2 días
-
priority/medium status/ready type/chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
discobox-ai/discobox#1357 ·
Los mantenedores suelen responder en 1 día
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itPosiblemente ocupada @fzn0x la tomó hoy. Abiertobug priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
edit_file diff rendering panics on invalid UTF-8 textPosiblemente ocupada @TDnorthgarden la tomó hoy. Abiertoarea/tui
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
docker/docker-agent#4955 ·
Los mantenedores suelen responder en 1 día