official

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a concrete implementation of our docker interface that uses the official client library.

func NewClient

func NewClient() (*Client, error)

NewClient creates and returns a new client.

func (*Client) CopyFromContainer

func (dockerClient *Client) CopyFromContainer(id string, path string) (io.ReadCloser, error)

CopyFromContainer returns a tar stream for a path within a container (like `docker cp CONTAINER -`).

func (*Client) CopyToContainer

func (dockerClient *Client) CopyToContainer(id string, path string, reader io.Reader) error

CopyToContainer takes a tar stream and copies it into the container.

func (*Client) CreateContainer

func (dockerClient *Client) CreateContainer(options *docker.CreateContainerOptions) (string, error)

CreateContainer creates a docker container.

func (*Client) CreateVolume

func (dockerClient *Client) CreateVolume(name string) (string, error)

CreateVolume creates a docker volume and returns its ID.

func (*Client) EnsureImage

func (dockerClient *Client) EnsureImage(image string, outputStream io.Writer) error

EnsureImage pulls an image if it does not exist locally.

func (*Client) Exec

func (dockerClient *Client) Exec(options *docker.ExecOptions) error

Exec execs a process in a docker container (like `docker exec` in the cli).

func (*Client) GetImageRepoDigests

func (dockerClient *Client) GetImageRepoDigests(image string) ([]string, error)

GetImageRepoDigests inspects an image and pulls out the repo digests.

func (*Client) PullImage

func (dockerClient *Client) PullImage(image string, outputStream io.Writer) error

PullImage pulls and image.

func (*Client) RemoveContainer

func (dockerClient *Client) RemoveContainer(id string) error

RemoveContainer removes a docker container.

func (*Client) RemoveVolume

func (dockerClient *Client) RemoveVolume(id string) error

RemoveVolume removes a docker volume given its ID.

func (*Client) Run

func (dockerClient *Client) Run(options *docker.RunOptions) error

Run runs a container (much like `docker run` in the cli).

func (*Client) SetDebugVolume added in v0.18.0

func (dockerClient *Client) SetDebugVolume(volume string)

SetDebugVolume sets a volume that will be mapped to /debug in each container, for an out of band way to get data out for testing.

func (*Client) Stop

func (dockerClient *Client) Stop(id string, timeout time.Duration) error

Stop stops a container.

func (*Client) VolumeExists added in v0.41.0

func (dockerClient *Client) VolumeExists(name string) (bool, error)

VolumeExists checks if a named volume exists.

type PullMessage added in v0.19.0

type PullMessage struct {
	Status         string
	ProgressDetail PullProgressDetail
	ID             string
}

PullMessage is the line format returned from dockder during an image pull.

type PullProgressDetail added in v0.19.0

type PullProgressDetail struct {
	Current  int64
	Total    int64
	Progress string
}

PullProgressDetail is the progress returned from docker for an image pull.

Jump to

Keyboard shortcuts

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