Documentation
¶
Index ¶
- func CheckDockerAccessible() bool
- func CheckLogDirMounted(containerID, logDir string) bool
- func CheckPortMapping(containerID, port string) (bool, error)
- func CheckStdinInteractive(containerID string) bool
- func DetectContainerID() (bool, string)
- func IsRunningInContainer() bool
- func ValidateContainerID(containerID string) error
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
CheckLogDirMounted uses docker inspect to verify the log directory is mounted.
func CheckPortMapping ¶ added in v0.3.1
CheckPortMapping uses docker inspect to verify that the specified port is mapped.
func CheckStdinInteractive ¶ added in v0.3.1
CheckStdinInteractive uses docker inspect to verify the container was started with -i flag.
func DetectContainerID ¶ added in v0.2.18
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
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.