devcontainers / devcontainers/cli

devcontainer features and mount

オープン
#881 コメント 0 件 リアクション 0 件 担当者 1 名 @chrmarti が担当を希望しています GitHub で見る
bug
主要言語
TypeScript
スター
3k
フォーク
457
平均マージ
13時間 17分
マージ済み PR(30日)
6

説明

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`

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。