devcontainers / devcontainers/cli

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

Đang mở
#857 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
feature-request
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ả

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 !

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.