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
- func Registration() providersdk.Registration
- type Config
- type CreateConfig
- type Driver
- func (d *Driver) Allocate(ctx context.Context, id string) (map[string]any, error)
- func (d *Driver) Availability(ctx context.Context) (*providersdk.ResourceAvailability, error)
- func (d *Driver) Create(ctx context.Context, cfg any) (*providersdk.Resource, error)
- func (d *Driver) Delete(ctx context.Context, id string) error
- func (d *Driver) List(ctx context.Context) ([]providersdk.ResourceStatus, error)
- func (d *Driver) Read(ctx context.Context, id string) (*providersdk.ResourceStatus, error)
- func (d *Driver) Type() providersdk.Type
- func (d *Driver) Update(ctx context.Context, id string, op providersdk.Operation) (*providersdk.Result, error)
- func (d *Driver) UpdateStream(ctx context.Context, id string, op providersdk.Operation, ...) (*providersdk.Result, error)
- type ExecOp
Constants ¶
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"`
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 (*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) List ¶ added in v0.1.29
func (d *Driver) List(ctx context.Context) ([]providersdk.ResourceStatus, error)
List returns every container this driver created, identified by managedLabel. It satisfies providersdk.ResourceLister.
func (*Driver) Read ¶
func (d *Driver) Read(ctx context.Context, id string) (*providersdk.ResourceStatus, error)
func (*Driver) Type ¶
func (d *Driver) Type() providersdk.Type
func (*Driver) Update ¶
func (d *Driver) Update(ctx context.Context, id string, op providersdk.Operation) (*providersdk.Result, error)
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.