running_in_container

Function running_in_container 

Source
pub fn running_in_container() -> bool
Expand description

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.