docker

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package docker implements a Docker-based infrastructure provider for the ctrlplane.

Index

Constants

This section is empty.

Variables

View Source
var ErrLogsNotImplemented = errors.New("docker: logs not implemented")

ErrLogsNotImplemented is returned when logs are not yet available.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Host is the Docker daemon address (e.g., unix:///var/run/docker.sock).
	Host string `env:"CP_DOCKER_HOST" json:"host"`

	// Network is the Docker network to attach containers to.
	Network string `default:"bridge" env:"CP_DOCKER_NETWORK" json:"network"`

	// Registry is the default image registry prefix.
	Registry string `env:"CP_DOCKER_REGISTRY" json:"registry,omitempty"`
}

Config holds configuration for the Docker provider.

type Provider

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

Provider is a Docker-based infrastructure provider.

func New

func New(cfg Config) *Provider

New creates a new Docker provider with the given configuration.

func (*Provider) Capabilities

func (p *Provider) Capabilities() []provider.Capability

Capabilities returns the set of features this provider supports.

func (*Provider) Deploy

Deploy pushes a new release to the instance.

func (*Provider) Deprovision

func (p *Provider) Deprovision(_ context.Context, _ id.ID) error

Deprovision tears down all resources for an instance.

func (*Provider) Exec

Exec runs a command inside the instance.

func (*Provider) Info

func (p *Provider) Info() provider.ProviderInfo

Info returns metadata about this provider.

func (*Provider) Logs

Logs streams logs for the instance.

func (*Provider) Provision

Provision creates infrastructure resources for an instance.

func (*Provider) Resources

func (p *Provider) Resources(_ context.Context, _ id.ID) (*provider.ResourceUsage, error)

Resources returns current resource utilization for an instance.

func (*Provider) Restart

func (p *Provider) Restart(_ context.Context, _ id.ID) error

Restart performs a stop followed by start cycle.

func (*Provider) Rollback

func (p *Provider) Rollback(_ context.Context, _ id.ID, _ id.ID) error

Rollback reverts to a previous release.

func (*Provider) Scale

func (p *Provider) Scale(_ context.Context, _ id.ID, _ provider.ResourceSpec) error

Scale adjusts the resource allocation for an instance.

func (*Provider) Start

func (p *Provider) Start(_ context.Context, _ id.ID) error

Start starts a stopped instance.

func (*Provider) Status

func (p *Provider) Status(_ context.Context, _ id.ID) (*provider.InstanceStatus, error)

Status returns the current runtime status of an instance.

func (*Provider) Stop

func (p *Provider) Stop(_ context.Context, _ id.ID) error

Stop gracefully stops a running instance.

Jump to

Keyboard shortcuts

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