devcontainers / devcontainers/cli

devcontainer features and mount

Đang mở
#881 0 bình luận 0 reaction 1 người được giao Được @chrmarti nhận Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
3k
Fork
457
Merge trung bình
13 giờ 17 phút
Pull request đã merge (30 ngày)
6

Mô tả

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.
```js
"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
```ts
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`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.