docker

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 28 Imported by: 958

Documentation

Overview

Provides global docker information.

Handler for Docker containers.

Index

Constants

View Source
const DockerNamespace = "docker"

The namespace under which Docker aliases are unique.

Variables

View Source
var ArgDockerCA = flag.String("docker-tls-ca", "ca.pem", "path to trusted CA")
View Source
var ArgDockerCert = flag.String("docker-tls-cert", "cert.pem", "path to client certificate")
View Source
var ArgDockerEndpoint = flag.String("docker", "unix:///var/run/docker.sock", "docker endpoint")
View Source
var ArgDockerKey = flag.String("docker-tls-key", "key.pem", "path to private key")
View Source
var ArgDockerTLS = flag.Bool("docker-tls", false, "use TLS to connect to docker")
View Source
var (
	VersionRe = regexp.MustCompile(versionRegexpString)
)

Functions

func APIVersion added in v0.26.0

func APIVersion() ([]int, error)

func APIVersionString added in v0.26.0

func APIVersionString() (string, error)

func Client

func Client() (*dclient.Client, error)

Client creates a Docker API client based on the given Docker flags

func DetermineDeviceStorage added in v0.48.0

func DetermineDeviceStorage(storageDriver StorageDriver, storageDir string, rwLayerID string) (
	rootfsStorageDir string, zfsFilesystem string, zfsParent string, err error)

func FsStats added in v0.48.0

func FsStats(
	stats *info.ContainerStats,
	machineInfoFactory info.MachineInfoFactory,
	metrics container.MetricSet,
	storageDriver StorageDriver,
	fsHandler common.FsHandler,
	globalFsInfo fs.FsInfo,
	poolName string,
	rootfsStorageDir string,
	zfsParent string,
) error

func Images added in v0.23.1

func Images() ([]v1.DockerImage, error)

func Info added in v0.48.0

func Info() (*dockersystem.Info, error)

func NewPlugin added in v0.34.0

func NewPlugin() container.Plugin

NewPlugin returns an implementation of container.Plugin suitable for passing to container.RegisterPlugin()

func ParseVersion added in v0.48.0

func ParseVersion(versionString string, regex *regexp.Regexp, length int) ([]int, error)

func Register

func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includedMetrics container.MetricSet) error

Register root container before running this function!

func RootDir

func RootDir() string

func SetTimeout added in v0.29.0

func SetTimeout(timeout time.Duration)

func StartThinPoolWatcher added in v0.48.0

func StartThinPoolWatcher(dockerInfo *dockersystem.Info) (*devicemapper.ThinPoolWatcher, error)

func StartZfsWatcher added in v0.48.0

func StartZfsWatcher(dockerInfo *dockersystem.Info) (*zfs.ZfsWatcher, error)

func Status added in v0.23.1

func Status() (v1.DockerStatus, error)

func StatusFromDockerInfo added in v0.26.0

func StatusFromDockerInfo(dockerInfo dockersystem.Info) (v1.DockerStatus, error)

func StatusWithContext added in v0.29.0

func StatusWithContext(ctx context.Context) (v1.DockerStatus, error)

func ValidateInfo added in v0.23.0

func ValidateInfo(GetInfo func() (*dockersystem.Info, error), ServerVersion func() (string, error)) (*dockersystem.Info, error)

Checks whether the dockerInfo reflects a valid docker setup, and returns it if it does, or an error otherwise.

func VersionString added in v0.23.1

func VersionString() (string, error)

Types

type FsHandler added in v0.48.0

type FsHandler struct {
	FsHandler common.FsHandler

	// thinPoolWatcher is the devicemapper thin pool watcher
	ThinPoolWatcher *devicemapper.ThinPoolWatcher
	// deviceID is the id of the container's fs device
	DeviceID string

	// zfsWatcher is the zfs filesystem watcher
	ZfsWatcher *zfs.ZfsWatcher
	// zfsFilesystem is the docker zfs filesystem
	ZfsFilesystem string
}

FsHandler is a composite FsHandler implementation the incorporates the common fs handler, a devicemapper ThinPoolWatcher, and a zfsWatcher

func (*FsHandler) Start added in v0.48.0

func (h *FsHandler) Start()

func (*FsHandler) Stop added in v0.48.0

func (h *FsHandler) Stop()

func (*FsHandler) Usage added in v0.48.0

func (h *FsHandler) Usage() common.FsUsage

type StorageDriver added in v0.48.0

type StorageDriver string
const (
	DevicemapperStorageDriver StorageDriver = "devicemapper"
	AufsStorageDriver         StorageDriver = "aufs"
	OverlayStorageDriver      StorageDriver = "overlay"
	Overlay2StorageDriver     StorageDriver = "overlay2"
	ZfsStorageDriver          StorageDriver = "zfs"
	VfsStorageDriver          StorageDriver = "vfs"
)

Directories

Path Synopsis
The install package registers docker.NewPlugin() as the "docker" container provider when imported
The install package registers docker.NewPlugin() as the "docker" container provider when imported

Jump to

Keyboard shortcuts

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