docker

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

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

func APIVersion() ([]int, error)

func APIVersionString

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

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

func FsStats

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

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

func Info

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

func NewPlugin

func NewPlugin() container.Plugin

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

func ParseVersion

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

func SetTimeout(timeout time.Duration)

func StartThinPoolWatcher

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

func StartZfsWatcher

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

func Status

func Status() (v1.DockerStatus, error)

func StatusFromDockerInfo

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

func StatusWithContext

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

func ValidateInfo

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

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

func VersionString

func VersionString() (string, error)

Types

type FsHandler

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

func (h *FsHandler) Start()

func (*FsHandler) Stop

func (h *FsHandler) Stop()

func (*FsHandler) Usage

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

type StorageDriver

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