You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#1225
Add a flag to signify that we'd like to run a minimal init process that
can reap zombie processes. The actual support for this is in the
Containerization library so the plumbing here is very simple.
Copy file name to clipboardExpand all lines: docs/command-reference.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ container run [<options>] <image> [<arguments> ...]
50
50
*`--dns-option <option>`: DNS options
51
51
*`--dns-search <domain>`: DNS search domains
52
52
*`--entrypoint <cmd>`: Override the entrypoint of the image
53
+
*`--init`: Run an init process inside the container that forwards signals and reaps processes
53
54
*`--init-image <image>`: Use a custom init image instead of the default. This allows customizing boot-time behavior before the OCI container starts, such as running VM-level daemons, configuring eBPF filters, or debugging the init process.
54
55
*`-k, --kernel <path>`: Set a custom kernel path
55
56
*`-l, --label <label>`: Add a key=value label to the container
@@ -61,13 +62,14 @@ container run [<options>] <image> [<arguments> ...]
61
62
*`-p, --publish <spec>`: Publish a port from container to host (format: [host-ip:]host-port:container-port[/protocol])
62
63
*`--platform <platform>`: Platform for the image if it's multi-platform. This takes precedence over --os and --arch
63
64
*`--publish-socket <spec>`: Publish a socket from container to host (format: host_path:container_path)
65
+
*`--read-only`: Mount the container's root filesystem as read-only
64
66
*`--rm, --remove`: Remove the container after it stops
65
67
*`--rosetta`: Enable Rosetta in the container
68
+
*`--runtime`: Set the runtime handler for the container (default: container-runtime-linux)
66
69
*`--ssh`: Forward SSH agent socket to container
67
70
*`--tmpfs <tmpfs>`: Add a tmpfs mount to the container at the given path
68
71
*`-v, --volume <volume>`: Bind mount a volume into the container
69
72
*`--virtualization`: Expose virtualization capabilities to the container (requires host and guest support)
70
-
*`--runtime`: Set the runtime handler for the container (default: container-runtime-linux)
*`--entrypoint <cmd>`: Override the entrypoint of the image
213
+
*`--init`: Run an init process inside the container that forwards signals and reaps processes
208
214
*`--init-image <image>`: Use a custom init image instead of the default. This allows customizing boot-time behavior before the OCI container starts, such as running VM-level daemons, configuring eBPF filters, or debugging the init process.
209
215
*`-k, --kernel <path>`: Set a custom kernel path
210
216
*`-l, --label <label>`: Add a key=value label to the container
By default, the command you specify in `container run` runs as PID 1 inside the container. This means it is responsible for reaping zombie processes and handling signals, which many applications are not designed to do. The `--init` flag runs a lightweight init process as PID 1 that automatically forwards signals and reaps orphaned child processes.
503
+
504
+
```bash
505
+
container run --init ubuntu:latest my-app
506
+
```
507
+
508
+
The init process is also available with `container create`:
0 commit comments