Help us shape the future of Go! Take the 2026 Go Developer Survey

docker

package
v0.1.66 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package docker provides a providersdk.Driver backed by the local docker CLI.

Package docker provides a providersdk.Driver backed by the Docker Engine API.

Index

Constants

View Source
const ProviderType = "docker"

ProviderType is the registry key for Docker providers.

Variables

This section is empty.

Functions

func Registration

func Registration() providersdk.Registration

Registration returns the providersdk.Registration for the Docker provider.

Types

type Config

type Config struct {
	Host string `json:"host" yaml:"host"`
}

Config holds connection settings for a Docker daemon. This is the provider-level config from boxy.yaml providers[].config.

type CreateConfig

type CreateConfig struct {
	Image string `json:"image" yaml:"image"`
	// Source is intentionally unsupported: Docker consumes image references,
	// not raw disk/source bytes. The field exists so JSON decoding can produce
	// an explicit incompatibility error instead of silently ignoring a source.
	Source  *providersdk.SourceDescriptor `json:"source,omitempty" yaml:"source,omitempty"`
	Command []any                         `json:"command" yaml:"command"`
	Env     map[string]string             `json:"env" yaml:"env"`
	Labels  map[string]string             `json:"labels" yaml:"labels"`
	Ports   []string                      `json:"ports" yaml:"ports"`

	// Resources
	CPU    string `json:"cpu" yaml:"cpu"`
	Memory string `json:"memory" yaml:"memory"`
}

CreateConfig holds pool-level config for creating a container. This is the pool-level config from boxy.yaml pools[].config.

type Driver

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

Driver implements providersdk.Driver using the Docker Engine API.

func New

func New(cfg *Config) (*Driver, error)

New creates a Docker driver using the given config.

func (*Driver) Allocate

func (d *Driver) Allocate(ctx context.Context, id string) (map[string]any, error)

func (*Driver) Availability added in v0.1.59

func (d *Driver) Availability(ctx context.Context) (*providersdk.ResourceAvailability, error)

Availability reports Docker Engine host memory as a capacity estimate. Docker's Info endpoint exposes total host memory, not reliably free memory, so callers must not use this sample as an allocation rejection signal.

func (*Driver) Create

func (d *Driver) Create(ctx context.Context, cfg any) (*providersdk.Resource, error)

func (*Driver) Delete

func (d *Driver) Delete(ctx context.Context, id string) error

func (*Driver) List added in v0.1.29

List returns every container this driver created, identified by managedLabel. It satisfies providersdk.ResourceLister.

func (*Driver) Read

func (*Driver) Type

func (d *Driver) Type() providersdk.Type

func (*Driver) Update

func (*Driver) UpdateStream added in v0.1.34

func (d *Driver) UpdateStream(ctx context.Context, id string, op providersdk.Operation, sink eventstream.Sink) (*providersdk.Result, error)

type ExecOp

type ExecOp = providersdk.ExecOperation

ExecOp is retained as a provider-specific spelling of the shared command operation for compatibility with existing callers.

Jump to

Keyboard shortcuts

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