Documentation
¶
Index ¶
- func GetContainersUsingVolume(ctx context.Context, dockerClient *client.Client, volumeName string) ([]string, error)
- func GetCurrentContainerID() (string, error)
- func GetHostPathForContainerPath(ctx context.Context, dockerCli *client.Client, containerPath string) (string, error)
- func GetVolumeUsageData(ctx context.Context, dockerClient *client.Client) ([]volume.Volume, error)
- func InvalidateVolumeUsageCache()
- func IsDefaultNetwork(name string) bool
- func MountForDestination(mounts []containertypes.MountPoint, destination string, target string) *mounttypes.Mount
- type CgroupLimits
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentContainerID ¶
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 InvalidateVolumeUsageCache ¶
func InvalidateVolumeUsageCache()
func IsDefaultNetwork ¶
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)
Click to show internal directories.
Click to hide internal directories.