Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit e5d1e95

Browse files
authored
Remove forced "--init" in features to not consume PID 1 (#1289)
1 parent fee083e commit e5d1e95

File tree

5 files changed

+88
-10
lines changed

5 files changed

+88
-10
lines changed

script-library/container-features/src/devcontainer-features.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"buildArg": "_VSC_INSTALL_DOCKER_IN_DOCKER",
2222
"entrypoint": "/usr/local/share/docker-init.sh",
2323
"privileged": true,
24-
"init": true,
2524
"containerEnv": {
2625
"DOCKER_BUILDKIT": "1"
2726
},
@@ -76,7 +75,6 @@
7675
},
7776
"buildArg": "_VSC_INSTALL_DOCKER_FROM_DOCKER",
7877
"entrypoint": "/usr/local/share/docker-init.sh",
79-
"init": true,
8078
"containerEnv": {
8179
"DOCKER_BUILDKIT": "1"
8280
},
@@ -138,7 +136,6 @@
138136
"description": "Select or enter a Minikube version to install"
139137
}
140138
},
141-
"init": true,
142139
"buildArg": "_VSC_INSTALL_KUBECTL_HELM_MINIKUBE",
143140
"extensions": [
144141
"ms-kubernetes-tools.vscode-kubernetes-tools"

script-library/docs/desktop-lite.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@ You can use this script for your primary dev container by adding it to the `feat
5252
}
5353
```
5454

55-
If you have already built your development container, run the **Rebuild Container** command from the command palette (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>) to pick up the change.
56-
57-
If you run into applications crashing, you may need to increase the size of the shared memory space. For example, this will bump it up to 1 GB in `devcontainer.json`:
55+
If you run into applications crashing, you may need to increase the size of the shared memory space. For example, this will bump it up to 1 GB in `devcontainer.json` when you are referencing an image or Dockerfile:
5856

5957
```json
6058
"runArgs": ["--shm-size=1g"]
6159
```
6260

63-
Or using Docker Compose:
61+
Or when using Docker Compose:
6462

6563
```yaml
6664
services:
@@ -70,6 +68,24 @@ services:
7068
# ...
7169
```
7270

71+
**[Optional]** You may also want to enable the [tini init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to handle signals and clean up [Zombie processes](https://en.wikipedia.org/wiki/Zombie_process) if you do not have an alternative set up. To enable it, add the following to `devcontainer.json` if you are referencing an image or Dockerfile:
72+
73+
```json
74+
"runArgs": ["--init"]
75+
```
76+
77+
Or when using Docker Compose:
78+
79+
```yaml
80+
services:
81+
your-service-here:
82+
# ...
83+
init: true
84+
# ...
85+
```
86+
87+
If you have already built your development container, run the **Rebuild Container** command from the command palette (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>) to pick up the change.
88+
7389
### Script use
7490

7591
1. Add [`desktop-lite-debian.sh`](../desktop-lite-debian.sh) to `.devcontainer/library-scripts`
@@ -109,7 +125,7 @@ services:
109125
init: true
110126
```
111127

112-
The `runArgs` / Docker Compose setting allows the container to take advantage of an [init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to handle application and process signals in a desktop environment.
128+
The `runArgs` / Docker Compose setting allows the container to take advantage of an [init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to handle application and process signals in a desktop environment. However, this is optional.
113129

114130
4. [Optional] If you run into applications crashing, you may need to increase the size of the shared memory space. For example, this will bump it up to 1 GB in `devcontainer.json`:
115131

script-library/docs/docker-in-docker.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ You can use this script for your primary dev container by adding it to the `feat
5252
}
5353
```
5454

55+
**[Optional]** You may also want to enable the [tini init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to handle signals and clean up [Zombie processes](https://en.wikipedia.org/wiki/Zombie_process) if you do not have an alternative set up. To enable it, add the following to `devcontainer.json` if you are referencing an image or Dockerfile:
56+
57+
```json
58+
"runArgs": ["--init"]
59+
```
60+
61+
Or when using Docker Compose:
62+
63+
```yaml
64+
services:
65+
your-service-here:
66+
# ...
67+
init: true
68+
# ...
69+
```
70+
5571
If you have already built your development container, run the **Rebuild Container** command from the command palette (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>) to pick up the change.
5672

5773
### Script use
@@ -93,7 +109,7 @@ See the [`docker-in-docker`](../../containers/docker-in-docker) definition for a
93109

94110
The `dind-var-lib-docker` volume mount is optional but will ensure that containers / volumes you create within the dev container survive a rebuild. You should update `dind-var-lib-docker` with a unique name for your container to avoid corruption when multiple containers write to it at the same time.
95111

96-
While technically optional, `--init` enables an [init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to properly handle signals and ensure [Zombie Processes](https://en.wikipedia.org/wiki/Zombie_process) are cleaned up.
112+
While technically optional, `--init` enables the [tini init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to properly handle signals and ensure [Zombie Processes](https://en.wikipedia.org/wiki/Zombie_process) are cleaned up.
97113

98114
4. If you want any containers or volumes you create inside the container to survive it being deleted, you can use a "named volume". And the following to `.devcontainer/devcontainer.json` if you are referencing an image or Dockerfile replacing `dind-var-lib-docker` with a unique name for your container:
99115

script-library/docs/docker.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ You can use this script for your primary dev container by adding it to the `feat
5555
}
5656
```
5757

58+
**[Optional]** You may also want to enable the [tini init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to handle signals and clean up [Zombie processes](https://en.wikipedia.org/wiki/Zombie_process) if you do not have an alternative set up. To enable it, add the following to `devcontainer.json` if you are referencing an image or Dockerfile:
59+
60+
```json
61+
"runArgs": ["--init"]
62+
```
63+
64+
Or when using Docker Compose:
65+
66+
```yaml
67+
services:
68+
your-service-here:
69+
# ...
70+
init: true
71+
# ...
72+
```
73+
5874
If you have already built your development container, run the **Rebuild Container** command from the command palette (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>) to pick up the change.
5975

6076
### Script use
@@ -98,7 +114,7 @@ See the [`docker-from-docker`](../../containers/docker-from-docker) and [`docker
98114
- /var/run/docker.sock:/var/run/docker-host.sock
99115
```
100116

101-
While technically optional, `--init` enables an [init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to properly handle signals and ensure [Zombie Processes](https://en.wikipedia.org/wiki/Zombie_process) are cleaned up.
117+
While technically optional, `--init` enables the [tini init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to properly handle signals and ensure [Zombie Processes](https://en.wikipedia.org/wiki/Zombie_process) are cleaned up.
102118

103119
4. If you are running the container as something other than root (either via `USER` in your Dockerfile or `containerUser`), you'll need to ensure that the user has `sudo` access. (If you run the container as root and just reference the user in `remoteUser` you will not have this problem, so this is recommended instead.) The [`debian-common.sh`](common.md) script can do this for you, or you [set one up yourself](https://aka.ms/vscode-remote/containers/non-root).
104120

script-library/docs/kubectl-helm.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ You can use this script for your primary dev container by adding it to the `feat
5252
}
5353
```
5454

55+
**[Optional]** You may also want to enable the [tini init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to handle signals and clean up [Zombie processes](https://en.wikipedia.org/wiki/Zombie_process) if you do not have an alternative set up. To enable it, add the following to `devcontainer.json` if you are referencing an image or Dockerfile:
56+
57+
```json
58+
"runArgs": ["--init"]
59+
```
60+
61+
Or when using Docker Compose:
62+
63+
```yaml
64+
services:
65+
your-service-here:
66+
# ...
67+
init: true
68+
# ...
69+
```
70+
5571
If you have already built your development container, run the **Rebuild Container** command from the command palette (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>) to pick up the change.
5672

5773
### Script use
@@ -74,6 +90,23 @@ Usage:
7490
RUN apt-get update && bash /tmp/library-scripts/kubectl-helm-debian.sh latest latest latest
7591
```
7692

93+
3. **[Optional]** You may also want to enable the [tini init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to properly handle signals and ensure [Zombie Processes](https://en.wikipedia.org/wiki/Zombie_process) are cleaned up if you do not have an alternative set up. To do so, add the following to `.devcontainer/devcontainer.json` if you are referencing an image or Dockerfile:
94+
95+
```json
96+
"runArgs": ["--init"]
97+
```
98+
99+
Or if you are referencing a Docker Compose file, add this to your `docker-compose.yml` file instead:
100+
101+
```yaml
102+
your-service-name-here:
103+
# ...
104+
init: true
105+
# ...
106+
```
107+
108+
While technically optional, `
109+
77110
3. You may also want to install Docker using the [docker-in-docker](docker-in-docker.md) or [docker-from-docker](docker.md) scripts.
78111

79112
That's it!

0 commit comments

Comments
 (0)