docker

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 48 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingDeviceDriver = errors.New("Docker is missing required device driver")

Functions

func GetHostPortForContainer added in v0.14.11

func GetHostPortForContainer(ctx context.Context, dockerCommand command.Command, containerID string, containerPort int, hostIP string) (int, error)

func IsRemoteDockerHost added in v0.22.0

func IsRemoteDockerHost() (bool, string, error)

IsRemoteDockerHost reports whether the configured Docker daemon is not a local Unix socket or named pipe. When true, port bindings are applied on the remote daemon's interfaces, so localhost bindings may not be reachable from the local machine.

func NewClient added in v0.14.12

func NewClient(ctx context.Context, opts ...Option) (*apiClient, error)

func ParseSecretsFromHost added in v0.15.0

func ParseSecretsFromHost(workingDir string, secrets []string) (secrets.SecretStore, error)

func Run added in v0.0.8

func Run(ctx context.Context, dockerClient command.Command, options command.RunOptions) error

func RunDaemon added in v0.0.8

func RunDaemon(ctx context.Context, dockerClient command.Command, options command.RunOptions, stderr io.Writer) (string, error)

func RunWithIO added in v0.0.8

func RunWithIO(ctx context.Context, dockerClient command.Command, options command.RunOptions, stdin io.Reader, stdout, stderr io.Writer) error

func SaveLoginToken added in v0.0.8

func SaveLoginToken(ctx context.Context, registryHost string, username string, token string) error

func StandardPush added in v0.14.0

func StandardPush(ctx context.Context, image string, command command.Command) error

Types

type CredentialHelperInput added in v0.14.0

type CredentialHelperInput struct {
	Username  string
	Secret    string //nolint:gosec // G117: this is a Docker credential, not a hardcoded secret
	ServerURL string
}

type Option added in v0.14.12

type Option func(*clientOptions)

func WithAuthConfig added in v0.14.12

func WithAuthConfig(authConfig registry.AuthConfig) Option

func WithHost added in v0.15.10

func WithHost(host string) Option

type ProgressWriter added in v0.17.0

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

ProgressWriter renders keyed progress updates with Docker's jsonmessage renderer.

It uses the same ANSI cursor handling and terminal resize behavior as `docker push`.

func NewProgressWriter added in v0.17.0

func NewProgressWriter() *ProgressWriter

NewProgressWriter creates a ProgressWriter that renders progress to stderr.

func (*ProgressWriter) Close added in v0.17.0

func (p *ProgressWriter) Close()

Close shuts down the progress display. Safe to call multiple times.

func (*ProgressWriter) Write added in v0.17.0

func (p *ProgressWriter) Write(id, status string, current, total int64)

Write sends a progress update for an item identified by id. status is the current operation, such as "Pushing". current and total are the byte counts for the progress bar.

func (*ProgressWriter) WriteLine added in v0.22.0

func (p *ProgressWriter) WriteLine(message string)

WriteLine writes a non-progress line and clears the tracked progress rows.

func (*ProgressWriter) WriteStatus added in v0.17.0

func (p *ProgressWriter) WriteStatus(id, status string)

WriteStatus replaces a progress row with a status and no progress bar.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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