devcontainers / devcontainers/cli

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

Aperta
#857 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature-request
Lingua principale
TypeScript
Stelle
3k
Fork
457
Merge medio
13h 17m
PR unite (30g)
6

Descrizione

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 !

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.