docker

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainersUsingVolume

func GetContainersUsingVolume(ctx context.Context, dockerClient *client.Client, volumeName string) ([]string, error)

func GetCurrentContainerID

func GetCurrentContainerID() (string, error)

GetCurrentContainerID detects the current container ID using multiple detection methods It tries cgroup, mountinfo, and hostname in that order

func GetHostPathForContainerPath

func GetHostPathForContainerPath(ctx context.Context, dockerCli *client.Client, containerPath string) (string, error)

GetHostPathForContainerPath attempts to discover the host-side path for a given container path by inspecting the container itself. This is useful for Docker-in-Docker scenarios where the application needs to know host paths for volume mapping.

func GetVolumeUsageData

func GetVolumeUsageData(ctx context.Context, dockerClient *client.Client) ([]volume.Volume, error)

func InvalidateVolumeUsageCache

func InvalidateVolumeUsageCache()

func IsDefaultNetwork

func IsDefaultNetwork(name string) bool

func MountForDestination

func MountForDestination(mounts []containertypes.MountPoint, destination string, target string) *mounttypes.Mount

MountForDestination returns a Mount suitable for container creation that mirrors an existing container mount at the given destination.

It currently supports bind and named volume mounts. If target is empty, destination is used as the target.

Types

type CgroupLimits

type CgroupLimits struct {
	MemoryLimit int64
	MemoryUsage int64
	CPUQuota    int64
	CPUPeriod   int64
	CPUCount    int
}

func DetectCgroupLimits

func DetectCgroupLimits() (*CgroupLimits, error)

Jump to

Keyboard shortcuts

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