spec icon indicating copy to clipboard operation
spec copied to clipboard

Feature `mounts` schema rejects the `--mount` options the spec promises (e.g. `volume-subpath`)

Open hansehart opened this issue 1 month ago • 2 comments

The features spec says each mounts entry "accepts the same values as the Docker CLI --mount flag" (devcontainer-features.md), but the schema only allows three keys. Mount in schemas/devContainerFeature.schema.json (line 314) is an object with source, target and type, and "additionalProperties": false. So options like readonly or volume-subpath can't be declared by a feature.

Use case: several features sharing one named volume, each mounting only its own subfolder, which Docker supports since Engine 26.0 and Compose since 2.26.0:

"mounts": [{ "source": "programs", "target": "/opt/texlive", "type": "volume", "volume-subpath": "texlive" }]

Proposal: allow the --mount options in the Mount schema (at least readonly and volume-subpath), and have implementations pass them through to docker run --mount and to Compose's long volume syntax.

Related: #754 (string vs. object mounts), devcontainers/cli#881 and devcontainers/cli#1314 (the CLI drops readonly).

hansehart avatar Oct 20 '26 20:10 hansehart

"mounts": [{ "source": "programs", "target": "/opt/texlive", "type": "volume", "volume-subpath": "texlive" }]

0943916975 avatar Nov 02 '26 00:11 0943916975

"mounts": [{ "source": "programs", "target": "/opt/texlive", "type": "volume", "volume-subpath": "texlive" }]

0943916975 avatar Nov 02 '26 00:11 0943916975