devcontainers / devcontainers/cli

`runArgs` in Dev Containers image isn't shared to `.devcontainers.json` workspace

未关闭
#857 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
feature-request
主要语言
TypeScript
星标
3k
派生
457
平均合并
13 小时 17 分钟
30 天内合并 PR
6

描述

Hi, I tried to use `runArgs` in Dev Containers custom image but this field isn't shared to `.devcontainers.json` workspace

- Logs :

1. when `runArgs` is set in Dev Containers custom image :

```sh
$ docker inspect f | grep PidMode
"PidMode": "", # pid isn't set to host
```

```sh
$ docker inspect f | grep NetworkMode
"NetworkMode": "bridge", # network isn't set to host
```

2. when `runArgs` is set in Dev Containers workspace that use the custom image :

```sh
$ docker inspect f | grep PidMode
"PidMode": "host", # pid is set to host

$ docker inspect f | grep NetworkMode
"NetworkMode": "host", # network is set to host
```

Steps to Reproduce :

1. when `runArgs` is set in Dev Containers custom image :

```json
// custom image configuration
{
"name": "Custom image",
"build": {
"dockerfile": "Dockerfile",
"args": {
"devcontainercli": "true"
}
},
"runArgs": [
"--network=host",
"--pid=host"
],
"capAdd": ["ALL"],
"securityOpt": ["seccomp=unconfined"],
"privileged": true,
[...]
}

// devcontainer.json workspace configuration
{
"name": "Dev Containers demo",
"image": "registry.example.com/example/custom-image:version",
[...]
}
```

2. when `runArgs` is set in Dev Containers workspace that use the custom image :

```json
// custom image configuration
{
"name": "Custom image",
"build": {
"dockerfile": "Dockerfile",
"args": {
"devcontainercli": "true"
}
},
"capAdd": ["ALL"],
"securityOpt": ["seccomp=unconfined"],
"privileged": true,
[...]
}

// devcontainer.json workspace configuration
{
"name": "Dev Containers demo",
"image": "registry.example.com/example/custom-image:version",
"runArgs": [
"--network=host",
"--pid=host"
],
[...]
}
```

Thank you !

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。