docker

package
v0.0.0-...-442c835 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MPL-2.0 Imports: 36 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is set at compile time.
	Version = "0.0.0"

	PluginID = loader.PluginID{
		Name:       pluginName,
		PluginType: base.PluginTypeDriver,
	}
)

Functions

func IsErrNotRunning

func IsErrNotRunning(err error) bool

IsErrNotRunning checks an error if the container is not running.

func PluginLoader

func PluginLoader(opts map[string]string) (map[string]interface{}, error)

Types

type ContainerGCConfig

type ContainerGCConfig struct {
	// Enabled controls whether the container reconciler is enabled
	Enabled bool `codec:"enabled"`

	// DryRun indicates that the reconciler should log unexpectedly running containers
	// if found without actually killing them
	DryRun bool `codec:"dry_run"`

	// Period controls the frequency of scanning containers
	Period string `codec:"period"`

	// CreationGrace is the duration allowed for newly created container
	// to live without being registered as a running task in nomad.
	// A container is treated as leaked if it lived more than a grace duration
	// and haven't been registered in tasks.
	CreationGrace string `codec:"creation_grace"`
	// contains filtered or unexported fields
}

ContainerGCConfig controls the behavior of the GC reconcilier to detects dangling nomad containers that aren't tracked due to docker/nomad bugs.

type DockerLogging

type DockerLogging struct {
	Type   string             `codec:"type"`
	Driver string             `codec:"driver"`
	Config hclutils.MapStrStr `codec:"config"`
}

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(logger hclog.Logger) *Driver

NewDriver retuns a docker implementation of a driver plugin

func (*Driver) Capabilities

func (d *Driver) Capabilities() (*drivers.Capabilities, error)

func (*Driver) ConfigSchema

func (d *Driver) ConfigSchema() (*hclspec.Spec, error)

ConfigSchema returns the schema for parsing the plugins configuration.

func (*Driver) DestroyTask

func (d *Driver) DestroyTask(taskID string, force bool) error

func (*Driver) ExecTask

func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)

func (*Driver) Fingerprint

func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)

func (*Driver) InspectTask

func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)

func (*Driver) PluginInfo

func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)

PluginInfo describes the type and version of a plugin.

func (*Driver) RecoverTask

func (d *Driver) RecoverTask(*drivers.TaskHandle) error

func (*Driver) SetConfig

func (d *Driver) SetConfig(c *base.Config) error

SetConfig is used to set the configuration by passing a MessagePack encoding of it.

func (*Driver) SignalTask

func (d *Driver) SignalTask(taskID string, signal string) error

func (*Driver) StartTask

func (*Driver) StopTask

func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error

func (*Driver) TaskConfigSchema

func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)

func (*Driver) TaskEvents

func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)

func (*Driver) TaskStats

func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *cstructs.TaskResourceUsage, error)

func (*Driver) WaitTask

func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)

type DriverConfig

type DriverConfig struct {
	Endpoint            string   `codec:"endpoint"`
	GC                  GCConfig `codec:"gc"`
	AllowCaps           []string `codec:"allow_caps"`
	GPURuntimeName      string   `codec:"nvidia_runtime"`
	PullActivityTimeout string   `codec:"pull_activity_timeout"`
	// contains filtered or unexported fields
}

type GCConfig

type GCConfig struct {
	Image      bool   `codec:"image"`
	ImageDelay string `codec:"image_delay"`

	Container          bool              `codec:"container"`
	DanglingContainers ContainerGCConfig `codec:"dangling_containers"`
	// contains filtered or unexported fields
}

type LogEventFn

type LogEventFn func(message string, annotations map[string]string)

LogEventFn is a callback which allows Drivers to emit task events.

type TaskConfig

type TaskConfig struct {
	Args             []string           `codec:"args"`
	CapAdd           []string           `codec:"cap_add"`
	CapDrop          []string           `codec:"cap_drop"`
	Command          string             `codec:"command"`
	DNSOptions       []string           `codec:"dns_options"`
	DNSSearchDomains []string           `codec:"dns_search_domains"`
	DNSServers       []string           `codec:"dns_servers"`
	ForcePull        bool               `codec:"force_pull"`
	Image            string             `codec:"image"`
	Labels           hclutils.MapStrStr `codec:"labels"`
	LoadImage        string             `codec:"load"`
	Logging          DockerLogging      `codec:"logging"`
	MacAddress       string             `codec:"mac_address"`
	PortMap          hclutils.MapStrInt `codec:"port_map"`
	SecurityOpt      []string           `codec:"security_opt"`
	StorageOpt       map[string]string  `codec:"storage_opt"`
	WorkDir          string             `codec:"work_dir"`
}

Jump to

Keyboard shortcuts

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