Documentation ¶
Overview ¶
Package container provides methods for checking container engine info
Index ¶
Examples ¶
Constants ¶
View Source
const ( DOCKER = "docker" // Docker (Moby) PODMAN = "podman" // Podman LXC = "lxc" // LXC )
Variables ¶
This section is empty.
Functions ¶
func GetEngine ¶
func GetEngine() string
GetEngine returns container engine name if used
Example ¶
fmt.Printf("Container engine: %s\n", GetEngine())
Output:
func IsContainer ¶ added in v12.108.0
func IsContainer() bool
IsContainer returns true if we are inside container
Example ¶
if !IsContainer() { fmt.Println("It's not containerized") } else { fmt.Printf("It's containerized using %s engine\n", GetEngine()) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.