Ctrl Plane

Docker

Local and single-host container orchestration using the Docker daemon.

The Docker provider connects Ctrl Plane to a Docker daemon for container lifecycle management. It is the default provider for local development and single-host deployments.

Status

Implemented — available in provider/docker.

Configuration

import "github.com/xraph/ctrlplane/provider/docker"

prov := docker.New(docker.Config{
    Host:     "unix:///var/run/docker.sock",
    Network:  "bridge",
    Registry: "ghcr.io/myorg",
})
FieldEnvDefaultDescription
HostCP_DOCKER_HOSTDocker daemon address
NetworkCP_DOCKER_NETWORKbridgeNetwork to attach containers to
RegistryCP_DOCKER_REGISTRYDefault image registry prefix

Capabilities

The Docker provider declares these capabilities:

CapabilitySupported
deployYes
scaleYes
logsYes
execYes
provisionVia container creation
volumesPlanned
gpuPlanned

Registration

cp, err := app.New(
    app.WithProvider("docker", prov),
    app.WithDefaultProvider("docker"),
)

How it works

  1. Provision creates a container reference using the instance ID.
  2. Deploy pulls the requested image and creates/replaces the container.
  3. Scale adjusts container resource limits via the Docker API.
  4. Start/Stop/Restart map directly to Docker container lifecycle commands.
  5. Status queries the container state and maps it to Ctrl Plane states.
  6. Exec runs commands inside the container using the Docker exec API.

When to use

  • Local development and testing
  • Single-host deployments
  • CI/CD pipelines that need real containers
  • Prototyping before moving to Kubernetes or cloud providers

Notes

  • The Docker provider connects to the Docker daemon via the configured host socket.
  • Container names follow the pattern ctrlplane-{instance-id}.
  • Environment variables and port mappings from the instance spec are passed through to the container.
  • For production multi-host deployments, consider the Kubernetes or cloud providers.

On this page