devcontainer features and mount
@chrmarti is already working on this.
Since Sep 3, 2024.
Assessment
This issue has not been assessed yet.
Description
Devcontainer uses both Docker and docker-compose to generate containers.
The features should theoretically ignore in which mode the reference container is created, but this does not seem to be respected by using ‘mounts’.
A feature that needs to mount with type=bind in readonly mode is not able to cover both docker and docker-compose commands.
"mounts": [
{
"source": "/local-path",
"target": "/remote-path:ro", // syntax for docker-compose
"type": "bind",
},
{
"source": "/local-path",
"target": "/remote-path,readonly", // syntax for docker
"type": "bind",
},
]
By using both strings or Mount Object, it is not possible to write a single functional mount.
The example above (it's the only way I found to make mount works) generates a wrong mount path /remote-path,readonly for docker-compose and /remote-path:ro for docker.
The problem probably can be solved through Mount interface
export interface Mount {
type: 'bind' | 'volume';
source?: string;
target: string;
external?: boolean;
readonly?: boolean
}
and use the property readonly to generate the right syntax for both docker-compose.yml and docker --mount
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 461
- Avg merge
- 18m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from devcontainers/cli
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
devcontainers/cli#1203 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
devcontainers/cli#1178 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
devcontainers/cli#1308 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
devcontainers/cli#1307 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
devcontainers/cli#1305 ·
All issues in devcontainers/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·