Module container_utils

Module container_utils 

Source
Expand description

Helpers for interacting with containers at runtime.

Constants§

OSTREE_BOOTED
The relative path to the stamp file which signals this is an ostree-booted system.
V0_REPO_CONFIG 🔒
V1_REPO_CONFIG 🔒

Functions§

is_bare_split_xattrs
Returns true if the current root filesystem has an ostree repository in bare-split-xattrs mode. This will be the case in a running ostree-native container.
is_ostree_booted_in
Returns true if the target root appears to have been booted via ostree.
is_ostree_container
Returns true if the current booted filesystem appears to be an ostree-native container.
open_optional 🔒
ostree_booted
Returns true if the system appears to have been booted via ostree. This accesses global state in /run.
require_ostree_container
Returns an error unless the current filesystem is an ostree-based container
running_in_container
Attempts to detect if the current process is running inside a container. This looks for the container environment variable or the presence of Docker or podman’s more generic /run/.containerenv. This is a best-effort function, as there is not a 100% reliable way to determine this.