Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ContainerRuntimes contains all the container runtimes. ContainerRuntimes = []ContainerRuntime{ RuntimeDocker, RuntimeRkt, RuntimeNspawn, RuntimeLXC, RuntimeLXCLibvirt, RuntimeOpenVZ, RuntimeKubernetes, RuntimeGarden, RuntimePodman, RuntimeGVisor, RuntimeFirejail, RuntimeWSL, } )
Functions ¶
func InContainer ¶ added in v1.25.25
func InContainer() bool
InContainer says whether the process finds itself in a container. kaniko asks this in two places, which have to agree: outside of a container it runs only with --force, and there it does not clean the root to retry a failed extraction of an image.
Types ¶
type ContainerRuntime ¶
type ContainerRuntime string
ContainerRuntime is the type for the various container runtime strings.
const ( // RuntimeDocker is the string for the docker runtime. RuntimeDocker ContainerRuntime = "docker" // RuntimeRkt is the string for the rkt runtime. RuntimeRkt ContainerRuntime = "rkt" // RuntimeNspawn is the string for the systemd-nspawn runtime. RuntimeNspawn ContainerRuntime = "systemd-nspawn" // RuntimeLXC is the string for the lxc runtime. RuntimeLXC ContainerRuntime = "lxc" // RuntimeLXCLibvirt is the string for the lxc-libvirt runtime. RuntimeLXCLibvirt ContainerRuntime = "lxc-libvirt" // RuntimeOpenVZ is the string for the openvz runtime. RuntimeOpenVZ ContainerRuntime = "openvz" // RuntimeKubernetes is the string for the kubernetes runtime. RuntimeKubernetes ContainerRuntime = "kube" // RuntimeGarden is the string for the garden runtime. RuntimeGarden ContainerRuntime = "garden" // RuntimePodman is the string for the podman runtime. RuntimePodman ContainerRuntime = "podman" // RuntimeGVisor is the string for the gVisor (runsc) runtime. RuntimeGVisor ContainerRuntime = "gvisor" // RuntimeFirejail is the string for the firejail runtime. RuntimeFirejail ContainerRuntime = "firejail" // RuntimeWSL is the string for the Windows Subsystem for Linux runtime. RuntimeWSL ContainerRuntime = "wsl" // RuntimeNotFound is the string for when no container runtime is found. RuntimeNotFound ContainerRuntime = "not-found" )
func GetContainerRuntime ¶
func GetContainerRuntime(tgid, pid int) ContainerRuntime
GetContainerRuntime returns the container runtime the process is running in. If pid is less than one, it returns the runtime for "self".