sys

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDockerAccessible added in v0.3.1

func CheckDockerAccessible() bool

CheckDockerAccessible verifies that the Docker daemon is accessible.

func CheckLogDirMounted added in v0.3.1

func CheckLogDirMounted(containerID, logDir string) bool

CheckLogDirMounted uses docker inspect to verify the log directory is mounted.

func CheckPortMapping added in v0.3.1

func CheckPortMapping(containerID, port string) (bool, error)

CheckPortMapping uses docker inspect to verify that the specified port is mapped.

func CheckStdinInteractive added in v0.3.1

func CheckStdinInteractive(containerID string) bool

CheckStdinInteractive uses docker inspect to verify the container was started with -i flag.

func DetectContainerID added in v0.2.18

func DetectContainerID() (bool, string)

DetectContainerID detects if the current process is running inside a container and attempts to extract the container ID from cgroup entries. It returns (isContainer, containerID). The containerID may be empty even when a container is detected (e.g., via /.dockerenv or environment variable).

func IsRunningInContainer added in v0.2.7

func IsRunningInContainer() bool

IsRunningInContainer detects if the current process is running inside a container.

func ValidateContainerID added in v0.3.1

func ValidateContainerID(containerID string) error

ValidateContainerID validates that the container ID is safe to use in commands. Container IDs should only contain lowercase hex characters (a-f, 0-9).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL