buildMountOptions warns "should not define `bind` option" for named volumes carrying only an SELinux relabel flag, which compose itself consumes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 62/100
調査の方向性
buildMountOptions() から始めてください。ここでは、type が volume で Bind が nil でない mount の場合に警告が出ます。buildContainerVolumes() と toBindString() が名前付きボリュームに対して v.Bind.SELinux をどのように使っているかを確認し、Bind が SELinux だけを設定している場合にのみ警告を省略するようにしてください。propagation や create_host_path など、他の Bind フィールドについては警告を残してください。z/Z の名前付きボリューム mount で警告が出ず、他の Bind フィールドを持つボリューム mount では警告が出続けることが、buildMountOptions のテストで確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 38.9k
- フォーク
- 6k
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 81
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/compose のほかの issue
-
[BUG] `docker compose port` prints `:0` (exit 0) for a port the image exposes but the service does not publish対応中かも @ndeloof が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[BUG] deploy.restart_policy without condition drops the restart policy再び着手できるかも @akshat-lakhera が 25 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
docker/compose#14383 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] up: an optional (required: false) service_healthy dependent is not started when a required dependent shares the failing wait対応中かも @ndeloof が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
docker/compose#14507 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Negative replica count in scale flags (docker compose scale / --scale) is accepted without validation対応中かも @arsalanyavari が 8 日前に担当しました。 オープンkind/bug status/approved
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
[BUG] pre_stop hooks are skipped when up or scale stops a container対応中かも @htoyoda18 が 11 日前に担当しました。 オープンkind/bug status/approved
難易度 4/5 3〜5日 初心者へのやさしさ 53/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
fluxcd/notification-controller#1441 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
OneBusAway/maglev#2145 ·
メンテナーはふだん 2 日以内に返信
-
priority/medium status/ready type/chore
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
discobox-ai/discobox#1357 ·
メンテナーはふだん 1 日以内に返信
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for it対応中かも @fzn0x が今日担当しました。 オープンbug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
edit_file diff rendering panics on invalid UTF-8 text対応中かも @TDnorthgarden が今日担当しました。 オープンarea/tui
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
docker/docker-agent#4955 ·
メンテナーはふだん 1 日以内に返信