docker-compose
Deploy the LinuxGuard agent with docker-compose — compose.yaml example, capabilities, host paths, restart policy, and PID 1 considerations.
compose.yaml
services:
linuxguard-agent:
# Pin to an immutable tag; never :latest in production.
image: packages.linuxguard.io/linuxguard-agent:v3.0.0
container_name: linuxguard-agent
# Restart unless explicitly stopped — pairs well with --tls-cache so
# restarts reuse the cached cert chain rather than re-enrolling.
restart: unless-stopped
# PID 1 auto-detection: the agent IS the container's main process.
# An init shim is NOT required — the agent's pid1 build tag installs
# its own zombie-reaper. Do NOT set `init: true` on this service.
init: false
# Host PID so the agent observes all processes on the node.
pid: host
# Add the five capabilities the file-cap transition requires.
cap_add:
- BPF
- PERFMON
- DAC_READ_SEARCH
- SYS_PTRACE
- SETPCAP
# Drop everything else; defense-in-depth against image updates that
# might add new capabilities silently.
cap_drop:
- ALL
# Default Docker seccomp profile blocks perf_event_open(2). Use
# `unconfined` for UAT/dev; for production, supply a custom profile
# that adds perf_event_open to the allowlist.
security_opt:
- seccomp=unconfined
# For production, replace the above with:
# - seccomp=/etc/docker/seccomp-linuxguard.json
# - apparmor=linuxguard-agent
# Read-only image filesystem.
read_only: true
# tmpfs for the TLS cert cache when --tls-cache is set.
tmpfs:
- /run/linuxguard:rw,mode=0700,size=10m
# tracefs bind-mount (read-only) for eBPF probe attach.
volumes:
- /sys/kernel/tracing:/sys/kernel/tracing:ro
# BPF FS for pinned maps (read-write).
- /sys/fs/bpf:/sys/fs/bpf
# host /proc for process introspection (read-only).
- /proc:/host/proc:ro
environment:
# Source the token from a .env file that is NOT checked into source
# control. The agent reads the env var once at startup and immediately
# unsets it to scrub /proc/<pid>/environ.
LINUXGUARD_ENROLL_TOKEN: ${LINUXGUARD_ENROLL_TOKEN}
LINUXGUARD_TENANT_ID: ${LINUXGUARD_TENANT_ID}
# In a non-Kubernetes deployment the workload-id MUST be supplied
# explicitly (no Downward API exists). Use a stable host identifier
# plus a stable UUID per deployment.
LINUXGUARD_NODE_NAME: ${LINUXGUARD_NODE_NAME:-${HOSTNAME}}
LINUXGUARD_POD_UID: ${LINUXGUARD_POD_UID}
command: ["start", "--tls-cache"]
# Resource limits — keep memory bounded; do not cap CPU (eBPF map
# operations spike briefly under load and CPU throttling drops events).
deploy:
resources:
limits:
memory: 512MRestart policies
Policy
When to use
PID 1 considerations
Do NOT set init: true
init: trueSIGTERM exit code
Volume mounts
Mount
Type
Direction
Justification
Environment variables
Variable
Source
Notes
Security context
Surface
Setting
Rationale
Host paths
Pod Security Standard compatibility
RBAC
Verification
Troubleshooting
OCI runtime create failed: ... operation not permitted
OCI runtime create failed: ... operation not permittedAgent exits immediately with bootstrap ephemeral: ... none of the three were present
bootstrap ephemeral: ... none of the three were presentAgent logs 400 tenantId required for TOTP enrollment
400 tenantId required for TOTP enrollmentinit: true causes the agent to skip ephemeral semantics
init: true causes the agent to skip ephemeral semanticsLast updated
Was this helpful?