docker

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const VolumeContainerDir = "/vol"

VolumeContainerDir is the path inside the container to the Docker volume.

Variables

This section is empty.

Functions

This section is empty.

Types

type Docker

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

Docker executes docker CLI commands to make and manage a single container.

func (*Docker) ExecCommand

func (d *Docker) ExecCommand(ctx context.Context, cmd []string) error

ExecCommand runs a command inside a running container. The container must have already been started with StartContainer().

func (*Docker) IsRunning

func (d *Docker) IsRunning() bool

IsRunning returns whether the Docker container is running.

func (*Docker) PullImage

func (d *Docker) PullImage(ctx context.Context, imageURI string) error

PullImage downloads a Docker image.

func (*Docker) RunContainer

func (d *Docker) RunContainer(ctx context.Context, imageURI, volumeHostDir string) error

RunContainer starts a Docker container process containing a new Docker volume. volumeHostDir is the path in the host filesystem that will be bound as the volume in the container, e.g. host:/tmp/dir may be bound as container:/vol

func (*Docker) StopContainer

func (d *Docker) StopContainer(ctx context.Context) error

StopContainer stops a running container.

Jump to

Keyboard shortcuts

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