Skip to main content

Docker Deployment

Run infrasagent as a Docker container alongside your application stack.


Single Container

docker run -d \
--name infrasagent \
--restart unless-stopped \
-v /path/to/agent.yaml:/etc/infrasagent/agent.yaml:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc:/host/proc:ro \
-p 4317:4317 \
-p 4318:4318 \
-p 8080:8080 \
-e INFRASAGE_API_KEY="${INFRASAGE_API_KEY}" \
ghcr.io/infrasage/infrasagent:latest \
-config /etc/infrasagent/agent.yaml

Docker Compose

# docker-compose.yaml
services:
infrasagent:
image: ghcr.io/infrasage/infrasagent:latest
restart: unless-stopped
command: ["-config", "/etc/infrasagent/agent.yaml"]
volumes:
- ./agent.yaml:/etc/infrasagent/agent.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc:/host/proc:ro
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "8080:8080" # Admin API
environment:
INFRASAGE_API_KEY: "${INFRASAGE_API_KEY}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 15s
timeout: 5s
retries: 3

# Your application — points OTLP at the agent
my-app:
image: my-app:latest
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: "http://infrasagent:4318"
OTEL_SERVICE_NAME: "my-app"
depends_on:
infrasagent:
condition: service_healthy

Sidecar Pattern

Run the agent as a sidecar in the same container network as your application:

# docker-compose.yaml
services:
my-app:
image: my-app:latest
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:4318"
network_mode: "service:infrasagent"
depends_on: [infrasagent]

infrasagent:
image: ghcr.io/infrasage/infrasagent:latest
command: ["-config", "/etc/infrasagent/agent.yaml"]
volumes:
- ./agent.yaml:/etc/infrasagent/agent.yaml:ro
environment:
INFRASAGE_API_KEY: "${INFRASAGE_API_KEY}"

Image Tags

TagDescription
latestMost recent stable release
1.x.yPinned release
mainBuilt from the main branch (not for production)

Images are published to ghcr.io/infrasage/infrasagent for linux/amd64 and linux/arm64.