From 75578aad61c1e9fae021223ece70cb83e3e2bcf2 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Sat, 22 Dec 2018 14:59:43 +0100 Subject: add container-init support Add support for executing an init binary as PID 1 in a container to forward signals and reap processes. When the `--init` flag is set for podman-create or podman-run, the init binary is bind-mounted to `/dev/init` in the container and "/dev/init --" is prepended to the container's command. The default base path of the container-init binary is `/usr/libexec/podman` while the default binary is catatonit [1]. This default can be changed permanently via the `init_path` field in the `libpod.conf` configuration file (which is recommended for packaging) or temporarily via the `--init-path` flag of podman-create and podman-run. [1] https://github.com/openSUSE/catatonit Fixes: #1670 Signed-off-by: Valentin Rothberg --- docs/libpod.conf.5.md | 3 +++ docs/podman-create.1.md | 8 ++++++++ docs/podman-run.1.md | 8 ++++++++ 3 files changed, 19 insertions(+) (limited to 'docs') diff --git a/docs/libpod.conf.5.md b/docs/libpod.conf.5.md index d63baeb88..c02d247fb 100644 --- a/docs/libpod.conf.5.md +++ b/docs/libpod.conf.5.md @@ -24,6 +24,9 @@ libpod to manage containers. **cgroup_manager**="" Specify the CGroup Manager to use; valid values are "systemd" and "cgroupfs" +**init_path**="" + Path to the container-init binary, which forwards signals and reaps processes within containers. Note that the container-init binary will only be used when the `--init` for podman-create and podman-run is set. + **hooks_dir**=["*path*", ...] Each `*.json` file in the path configures a hook for Podman containers. For more details on the syntax of the JSON files and the semantics of hook injection, see `oci-hooks(5)`. Podman and libpod currently support both the 1.0.0 and 0.1.0 hook schemas, although the 0.1.0 schema is deprecated. diff --git a/docs/podman-create.1.md b/docs/podman-create.1.md index 97d6e77b1..3a75a4b00 100644 --- a/docs/podman-create.1.md +++ b/docs/podman-create.1.md @@ -276,6 +276,14 @@ tmpfs: The volume is mounted onto the container as a tmpfs, which allows the use content that disappears when the container is stopped. ignore: All volumes are just ignored and no action is taken. +**--init** + +Run an init inside the container that forwards signals and reaps processes. + +**--init-path**="" + +Path to the container-init binary. + **-i**, **--interactive**=*true*|*false* Keep STDIN open even if not attached. The default is *false*. diff --git a/docs/podman-run.1.md b/docs/podman-run.1.md index c0a466a9c..971b8829a 100644 --- a/docs/podman-run.1.md +++ b/docs/podman-run.1.md @@ -285,6 +285,14 @@ the container for the volumes. content that disappears when the container is stopped. - `ignore`: All volumes are just ignored and no action is taken. +**--init** + +Run an init inside the container that forwards signals and reaps processes. + +**--init-path**="" + +Path to the container-init binary. + **-i**, **--interactive**=*true*|*false* Keep STDIN open even if not attached. The default is *false*. -- cgit v1.2.3-54-g00ecf