Container Integration
ContainerManager types and state, what it can and cannot start, health mapping, and where real container workloads run.
container.rs holds the kernel's types for sidecar services (databases, caches, external APIs) and a registry of them. At 0.8.4 it does not start containers itself. Real container workloads, including cogs, run through the workload runtime adapters described below.
Source: crates/clawft-kernel/src/container.rs, crates/clawft-kernel/src/workload_runtime/container.rs
What ContainerManager does today
The module is compiled unconditionally. ContainerManager::new has no container engine wired in: start_container returns ContainerError::DockerNotAvailable unless the manager was created with ContainerManager::simulated, which only flips state in memory and assigns a synthetic sim- container id for tests. A container whose image begins with the cog image prefix is refused even in simulation, because cog workloads must start through the governed engine adapters (start_container in container.rs). Treat the manager as a registry and state model, not an orchestrator.
ContainerConfig
pub struct ContainerConfig {
pub docker_socket: String, // default from default_docker_socket()
pub network_name: String, // default "weftos"
pub default_restart_policy: RestartPolicy,
pub health_check_interval_secs: u64,
}ContainerState
pub enum ContainerState { Pulling, Creating, Running, Stopping, Stopped, Failed(String) }Port mapping, volumes, restart policy
pub struct PortMapping { pub host_port: u16, pub container_port: u16, pub protocol: String }
pub struct VolumeMount { pub host_path: String, pub container_path: String, pub read_only: bool }
pub enum RestartPolicy { Never /* default */, OnFailure { max_retries: u32 }, Always }ManagedContainer bundles a name, image, optional container id, state, ports, env, volumes and an optional health endpoint.
Health mapping
ContainerManager::health_check maps Running to Healthy, Stopped to Unhealthy("stopped"), Failed to Unhealthy("failed: ...") and every other state (pulling, creating, stopping) to Degraded. ContainerService wraps the manager as a SystemService, so the result is visible in the kernel health system. With exochain, starts and stops append container chain events.
Where container workloads actually run
crates/clawft-kernel/src/workload_runtime/container.rs implements the container adapters for Apple container, Docker or OrbStack, and Podman. They run a one-binary image built locally from the verified artifact over an operator-pinned base image, fronted by an ingest relay when the cog's loopback is not the node's. WorkloadHost gates each transition and chains it as a workload.* event (ADR-099 section 5, ADR-100). See Placement and Cogs.
The containers Cargo feature exists in clawft-kernel and is empty (containers = []); it is off by default.