Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devcontainer features and mount #881

Open
Lupennat opened this issue Aug 28, 2024 · 0 comments
Open

devcontainer features and mount #881

Lupennat opened this issue Aug 28, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Lupennat
Copy link

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

@chrmarti chrmarti added the bug Something isn't working label Sep 3, 2024
@chrmarti chrmarti self-assigned this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants