docker

package
v0.0.0-...-9372558 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package docker provides helper methods for ChromeOS usage of Docker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerRunner

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

ContainerRunner runs Docker containers, handling authentication, mounting, etc.

func NewContainerRunner

func NewContainerRunner(runner cmd.CommandRunner) *ContainerRunner

NewContainerRunner returns a ContainerRunner that uses runner to run `docker` commands and other required commands (such as authenticating with `gcloud`).

func (*ContainerRunner) RunContainer

func (c *ContainerRunner) RunContainer(
	ctx context.Context,
	containerConfig *container.Config,
	hostConfig *container.HostConfig,
	containerImageInfo *api.ContainerImageInfo,
	runtimeOptions *RuntimeOptions,
) error

RunContainer runs a container with `docker run`.

type RuntimeOptions

type RuntimeOptions struct {
	// If true, use `gcloud auth configure-docker` instead of `docker login` to
	// authenticate with the registry. Note that this is never run with sudo.
	UseConfigureDocker bool
	// If true, don't use sudo when running docker. Note this doesn't affect the
	// authentication commands.
	NoSudo bool
	// Writer to send stdout from the docker command to, nil is valid (stdout
	// isn't captured or printed).
	StdoutBuf io.Writer
	// Writer to send stderr from the docker command to, nil is valid (stderr
	// isn't captured or printed).
	StderrBuf io.Writer
}

RuntimeOptions configures how docker and related auth commands are run.

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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