feat: add --init-image flag for specifying custom init filesystem images per VM (#937)

- Users can now specify an alternate image to use
  with the `container run ---init-image` flag.
This commit is contained in:
Manu Schiller
2026-02-09 18:11:27 -08:00
committed by GitHub
parent 474906daf9
commit cf9b335aa1
12 changed files with 240 additions and 12 deletions
+7
View File
@@ -50,6 +50,7 @@ container run [<options>] <image> [<arguments> ...]
* `--dns-option <option>`: DNS options
* `--dns-search <domain>`: DNS search domains
* `--entrypoint <cmd>`: Override the entrypoint of the image
* `--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.
* `-k, --kernel <path>`: Set a custom kernel path
* `-l, --label <label>`: Add a key=value label to the container
* `--mount <mount>`: Add a mount to the container (format: type=<>,source=<>,target=<>,readonly)
@@ -61,6 +62,7 @@ container run [<options>] <image> [<arguments> ...]
* `--platform <platform>`: Platform for the image if it's multi-platform. This takes precedence over --os and --arch
* `--publish-socket <spec>`: Publish a socket from container to host (format: host_path:container_path)
* `--rm, --remove`: Remove the container after it stops
* `--rosetta`: Enable Rosetta in the container
* `--ssh`: Forward SSH agent socket to container
* `--tmpfs <tmpfs>`: Add a tmpfs mount to the container at the given path
* `-v, --volume <volume>`: Bind mount a volume into the container
@@ -101,6 +103,9 @@ container run -e NODE_ENV=production --cpus 2 --memory 1G node:18
# run a container with a specific MAC address
container run --network default,mac=02:42:ac:11:00:02 ubuntu:latest
# run a container with a custom init image for boot customization
container run --init-image local/custom-init:latest ubuntu:latest
```
### `container build`
@@ -200,6 +205,7 @@ container create [<options>] <image> [<arguments> ...]
* `--dns-option <option>`: DNS options
* `--dns-search <domain>`: DNS search domains
* `--entrypoint <cmd>`: Override the entrypoint of the image
* `--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.
* `-k, --kernel <path>`: Set a custom kernel path
* `-l, --label <label>`: Add a key=value label to the container
* `--mount <mount>`: Add a mount to the container (format: type=<>,source=<>,target=<>,readonly)
@@ -211,6 +217,7 @@ container create [<options>] <image> [<arguments> ...]
* `--platform <platform>`: Platform for the image if it's multi-platform. This takes precedence over --os and --arch
* `--publish-socket <spec>`: Publish a socket from container to host (format: host_path:container_path)
* `--rm, --remove`: Remove the container after it stops
* `--rosetta`: Enable Rosetta in the container
* `--ssh`: Forward SSH agent socket to container
* `--tmpfs <tmpfs>`: Add a tmpfs mount to the container at the given path
* `-v, --volume <volume>`: Bind mount a volume into the container