Container Guide

Creating, configuring, and managing Volt containers.

Running Containers

# Basic container
volt run --name myapp -d nginx

# With port mapping and environment variables
volt run --name api \
  -p 3000:3000 \
  -e DATABASE_URL=postgres://db:5432/app \
  -e NODE_ENV=production \
  node:20-slim npm start

# With volume mounts and resource limits
volt run --name db \
  -v /data/postgres:/var/lib/postgresql/data \
  --memory 1G \
  --cpus 2 \
  postgres:16

Manifests

For reproducible deployments, define workloads as YAML manifests:

# volt-manifest.yaml
name: web-api
base: node:20-slim
command: ["npm", "start"]
ports:
  - 3000:3000
environment:
  NODE_ENV: production
resources:
  memory: 512M
  cpus: 1
security:
  landlock:
    fs_read: ["/usr", "/app", "/etc/ssl"]
    fs_write: ["/tmp"]
    net_bind: [3000]
volt deploy -f volt-manifest.yaml

Lifecycle Management

# List running containers
volt ps

# Stop a container
volt stop myapp

# Start a stopped container
volt start myapp

# Restart
volt restart myapp

# Remove
volt rm myapp

# View logs
volt logs myapp --follow

# Execute command in running container
volt exec myapp -- sh

Networking

Volt containers use systemd-networkd for networking. Each container gets its own network namespace with a virtual ethernet pair.