docker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package docker implements the engine.Runtime interface using the Docker SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitReady

func WaitReady(ctx context.Context, host string, port int, timeout time.Duration) error

WaitReady polls a TCP port until it accepts connections or the context expires.

Types

type Runtime

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

Runtime implements engine.Runtime using the Docker Engine API.

func New

func New() (*Runtime, error)

New creates a new Docker runtime that connects to the local Docker daemon.

func (*Runtime) CopyTo

func (r *Runtime) CopyTo(ctx context.Context, c engine.Container, dest string, src io.Reader) error

CopyTo copies data from a reader into the container filesystem.

func (*Runtime) Create

func (r *Runtime) Create(ctx context.Context, spec engine.ContainerSpec) (engine.Container, error)

Create pulls the image when it is not already available locally, then starts a container.

func (*Runtime) Destroy

func (r *Runtime) Destroy(ctx context.Context, c engine.Container) error

Destroy stops and removes the container.

func (*Runtime) Exec

func (r *Runtime) Exec(ctx context.Context, c engine.Container, cmd []string) ([]byte, error)

Exec runs a command inside the container and returns combined output.

func (*Runtime) Logs

Logs returns the container's log output.

Jump to

Keyboard shortcuts

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