docker

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package docker implements RuntimeAdapter using the Docker Engine API. Requires /var/run/docker.sock to be mounted into the platform container.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

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

Runtime implements runtime.RuntimeAdapter using the Docker Engine API.

func New

func New(networkName string, logger *slog.Logger) (*Runtime, error)

New creates a DockerRuntime. networkName is the Docker network plugins are attached to (default: "kleff").

func (*Runtime) Deploy

func (r *Runtime) Deploy(ctx context.Context, spec runtime.ContainerSpec) error

Deploy pulls the image and starts the container, replacing any existing one.

func (*Runtime) Endpoint

func (r *Runtime) Endpoint(_ context.Context, id string, port int) (string, error)

Endpoint returns the Docker-network hostname:port for the container. Docker's embedded DNS resolves the container name within the shared network.

func (*Runtime) Logs

func (r *Runtime) Logs(ctx context.Context, id string, lines int) ([]string, error)

Logs returns the last n lines of container stdout+stderr.

func (*Runtime) Remove

func (r *Runtime) Remove(ctx context.Context, id string) error

Remove stops and removes the container. Returns nil if not found.

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, id string) error

Start starts a stopped container.

func (*Runtime) Status

func (r *Runtime) Status(ctx context.Context, id string) (runtime.ContainerStatus, error)

Status returns the current state of the container.

func (*Runtime) Stop

func (r *Runtime) Stop(ctx context.Context, id string) error

Stop stops a running container gracefully.

Jump to

Keyboard shortcuts

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