`devcontainer up --mount` rejects `type=image` and mount options such as `subpath`
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- docker, docker-compose, typescript
調査の方向性
Trace how the --mount flag is validated and converted, then compare it with how string mounts from devcontainer.json reach the runtime. Check the Docker Compose path, where mounts use short syntax, and define a clear rejection for unsupported mount forms there. Done means runtime string mounts are passed through for supported runtimes, existing bind/volume behavior remains covered, and the linked pull request is reviewed for overlap.
索引モデルが issue の本文から書いたものです。
説明
What I want to do
I keep my personal tools (neovim, Claude Code) in a Nix-built OCI image and mount its /nix read-only into a team's dev container with an image mount. The team's devcontainer.json stays untouched, so the mount has to come from the command line:
devcontainer up --docker-path podman --workspace-folder . \
--mount "type=image,source=localhost/devtools:latest,target=/nix,subpath=/nix"
Podman (since 5.1) and Docker Engine (since 28, with the containerd image store) support --mount type=image. Docker spells the option image-subpath instead of subpath.
What happens
The CLI exits with:
Unmatched argument format: mount must match type=<bind|volume>,source=<source>,target=<target>[,external=<true|false>]
The same string works as an entry in mounts in devcontainer.json. The CLI passes string mounts to podman run verbatim, and with --log-level trace I see:
podman run ... --mount type=image,source=localhost/devtools:latest,target=/nix,subpath=/nix ...
Inside the container, /nix is a read-only overlay, and nvim --version and claude --version run from it. So the runtime handles the mount fine; only the --mount flag refuses it.
Why
In 0.89.0 the flag goes through two steps:
- A fixed regex validates it:
/^type=(bind|volume),source=([^,]+),target=([^,]+)(?:,external=(true|false))?$/. Any other type or option fails, includingreadonly. - The value is parsed into a mount object, and the object is serialized back as
type=...,src=...,dst=.... Options outside these three fields would be lost even if the regex allowed them.
The object form follows the spec's Mount schema (type is bind or volume, additionalProperties: false).
Proposal
When the --mount value does not match the bind/volume form, pass it to the container runtime as a string, the same way string entries in devcontainer.json mounts are handled today. The bind/volume parsing and external= keep working as now.
That covers type=image, subpath / image-subpath, readonly, volume-subpath, tmpfs and future runtime options without the CLI having to know each one. The runtime reports an invalid string itself.
For Docker Compose configs the string cannot be passed through as-is, since mounts are converted to the short source:target syntax there. Rejecting a non-bind/volume --mount with a clear error on the Compose path would be enough.
Workaround
--override-config with a full copy of the team's devcontainer.json plus the string mount. The copy has to be regenerated whenever the team changes their file, because --override-config replaces the config instead of merging it.
Environment
- @devcontainers/cli 0.89.0
- Podman 6.1.4, rootless, Debian 13 (Linux 6.12, x86_64)
Related
- devcontainers/spec#781: the Feature
Mountschema rejects--mountoptions such asvolume-subpath - devcontainers/spec#511: no way to declare a read-only mount in object form
- devcontainers/cli#881 and devcontainers/cli#1314:
readonlyis dropped when mounts are converted
- 主要言語
- TypeScript
- スター
- 3k
- フォーク
- 473
- 平均マージ
- 10時間 31分
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
devcontainers/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
devcontainers/cli#1325 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
devcontainers/cli#1203 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
devcontainers/cli#1178 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
up hangs after compose up -d on a cold start (Node 26, Compose 5.6)対応中かも @v-Kaniska244 が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
devcontainers/cli#1354 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
SELinux labelling does not get disabled when using Podman machines対応中かも @darshpatel1052 が 6 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 40/100
devcontainers/cli#1347 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
devcontainers/cli の issue をすべて見る
似ている issue
-
fehler
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Azure/azure-functions-nodejs-extensions#180 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
laaielichter/Threesmith#28 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 2 日以内に返信
-
iso-bmff: add IsoBoxReadView.readUint64 and IsoBoxWriteView.writeUint64 for exact 64-bit fieldsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
streaming-video-technology-alliance/common-media-library#611 ·
メンテナーはふだん 1 日以内に返信