docker

package
v0.25.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerTLSVerifyEnvVar is the Docker environment variable that indicates that
	// Docker socket is protected with TLS.
	DockerTLSVerifyEnvVar = "DOCKER_TLS_VERIFY"

	// DockerCertPathEnvVar is the Docker environment variable that specifies a
	// custom path to the TLS certificates for the Docker socket.
	DockerCertPathEnvVar = "DOCKER_CERT_PATH"
)
View Source
const (
	// SettingNetwork is the environment variable for the driver that specifies
	// the docker network to which the invocation image should be attached.
	SettingNetwork = "DOCKER_NETWORK"
)

Variables

This section is empty.

Functions

func BuildDockerClientOptions

func BuildDockerClientOptions() *cliflags.ClientOptions

BuildDockerClientOptions manually handles DOCKER_TLS_VERIFY and DOCKER_CERT_PATH because the docker cli library only binds these values when initializing its cli flags. There isn't other parts of the library that we can take advantage of to get these values for "free".

DOCKER_HOST however is retrieved dynamically later so that doesn't require additional configuration.

func GetDockerClient

func GetDockerClient() (*command.DockerCli, error)

GetDockerClient creates a Docker CLI client that uses the user's Docker configuration such as environment variables and the Docker home directory to initialize the client.

Types

type ConfigurationOption

type ConfigurationOption func(*container.Config, *container.HostConfig) error

ConfigurationOption is an option used to customize docker driver container and host config

type Driver

type Driver struct {

	// If true, this will not actually run Docker
	Simulate bool
	// contains filtered or unexported fields
}

Driver is capable of running Docker invocation images using Docker itself.

func (*Driver) AddConfigurationOptions

func (d *Driver) AddConfigurationOptions(opts ...ConfigurationOption)

AddConfigurationOptions adds configuration callbacks to the driver

func (*Driver) ApplyConfigurationOptions

func (d *Driver) ApplyConfigurationOptions() error

ApplyConfigurationOptions applies the configuration options set on the driver by the user.

func (*Driver) Config

func (d *Driver) Config() map[string]string

Config returns the Docker driver configuration options

func (*Driver) GetContainerConfig

func (d *Driver) GetContainerConfig() (container.Config, error)

GetContainerConfig returns a copy of the container configuration used by the driver during container exec

func (*Driver) GetContainerHostConfig

func (d *Driver) GetContainerHostConfig() (container.HostConfig, error)

GetContainerHostConfig returns a copy of the container host configuration used by the driver during container exec

func (*Driver) Handles

func (d *Driver) Handles(dt string) bool

Handles indicates that the Docker driver supports "docker" and "oci"

func (*Driver) Run

Run executes the Docker driver

func (*Driver) SetConfig

func (d *Driver) SetConfig(settings map[string]string) error

SetConfig sets Docker driver configuration

func (*Driver) SetContainerErr

func (d *Driver) SetContainerErr(w io.Writer)

SetContainerErr sets the container error stream

func (*Driver) SetContainerOut

func (d *Driver) SetContainerOut(w io.Writer)

SetContainerOut sets the container output stream

func (*Driver) SetDockerCli

func (d *Driver) SetDockerCli(dockerCli command.Cli)

SetDockerCli makes the driver use an already initialized cli

Jump to

Keyboard shortcuts

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