`devcontainer up --mount` rejects `type=image` and mount options such as `subpath`
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- docker, docker-compose, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 3k
- Fork
- 473
- Merge trung bình
- 10 giờ 31 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của devcontainers/cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
devcontainers/cli#1325 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
devcontainers/cli#1203 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
devcontainers/cli#1178 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
up hangs after compose up -d on a cold start (Node 26, Compose 5.6)Có thể đã có người làm @v-Kaniska244 đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
devcontainers/cli#1354 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SELinux labelling does not get disabled when using Podman machinesCó thể đã có người làm @darshpatel1052 đã nhận 6 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 40/100
devcontainers/cli#1347 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của devcontainers/cli
Issue tương tự
-
Absenderzeile über dem Anschriftfeld wird bei Angeboten und Rechnungen am Ende abgeschnittenĐang mởfehler
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/azure-functions-nodejs-extensions#180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
laaielichter/Threesmith#28 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 2 ngày
-
iso-bmff: add IsoBoxReadView.readUint64 and IsoBoxWriteView.writeUint64 for exact 64-bit fieldsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
streaming-video-technology-alliance/common-media-library#611 ·
Maintainer thường phản hồi trong vòng 1 ngày