docker

package
v0.0.0-...-6caf7d7 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 18

Documentation

Index

Constants

View Source
const (
	DefaultNetworkMode string = "default" // bridge
	HostNetworkMode    string = "host"
	BridgeNetworkMode  string = "bridge"
	NoneNetworkMode    string = "none"
	AwsvpcNetworkMode  string = "awsvpc"
	UnknownNetworkMode string = "unknown"
)

Container network modes

Variables

View Source
var (
	// ErrNotImplemented is the "not implemented" error given by `gopsutil` when an
	// OS doesn't support an API. Unfortunately it's in an internal package so
	// we can't import it so we'll copy it here.
	ErrNotImplemented = errors.New("not implemented yet")

	// ErrDockerNotAvailable is returned if Docker is not running on the current machine.
	// We'll use this when configuring the DockerUtil so we don't error on non-docker machines.
	ErrDockerNotAvailable = errors.New("docker not available")

	// ErrDockerNotCompiled is returned if docker support is not compiled in.
	// User classes should handle that case as gracefully as possible.
	ErrDockerNotCompiled = errors.New("docker support not compiled in")
)

Functions

func FindRancherIPInLabels

func FindRancherIPInLabels(labels map[string]string) (string, bool)

FindRancherIPInLabels looks for the `io.rancher.container.ip` label and parses it. Rancher 1.x containers don't have docker networks as the orchestrator provides its own CNI.

func GetHostname

func GetHostname(context.Context) (string, error)

GetHostname returns the hostname for docker

func GetMetadata

func GetMetadata() (map[string]string, error)

GetMetadata returns metadata about the docker runtime such as docker_version and if docker_swarm is enabled or not.

func GetTags

func GetTags(context.Context) ([]string, error)

GetTags returns tags that are automatically added to metrics and events on a host that is running docker.

Types

This section is empty.

Jump to

Keyboard shortcuts

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