Menu
Baba docs

Docker

The orochibraru/baba image (linux/amd64 and linux/arm64) runs baba start and checks its own health with baba health. It needs to see the host, not the container, so it runs privileged in the host's PID and network namespaces.

Docker Compose

curl -o config.json https://raw.githubusercontent.com/orochibraru/baba/main/config.example.json
curl -o compose.yaml https://raw.githubusercontent.com/orochibraru/baba/main/compose.example.yaml
# edit config.json: at least one notifier
docker compose up -d

The compose file mounts config.json at /app/config.json and a volume at /app/tmp for the incident history. The image points baba there with BABA_CONFIG_PATH=/app/config.json and BABA_DATABASE_PATH=/app/tmp/incidents.json.

BABA_DATABASE_PATH overrides database.path from config.json: in the container, the history always lives in /app/tmp.

docker run

With a config file:

docker run -d \
  --name baba \
  --restart unless-stopped \
  --privileged --pid=host --network=host \
  -v /sys:/sys:ro \
  -v /dev:/dev:ro \
  -v /path/to/config.json:/app/config.json:ro \
  -v /path/to/data:/app/tmp \
  orochibraru/baba:latest

With environment variables only: without a config file, baba starts from the defaults and the BABA_* variables, and only needs a notifier.

docker run -d \
  --name baba \
  --restart unless-stopped \
  --privileged --pid=host --network=host \
  -v /sys:/sys:ro \
  -v /dev:/dev:ro \
  -v /path/to/data:/app/tmp \
  -e BABA_NOTIFIERS_DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/<id>/<token> \
  orochibraru/baba:latest

Every variable is in Environment variables.

Why these flags

FlagReason
--privilegedAccess to hardware sensors (temperature)
--pid=hostShares the host PID namespace so /proc reflects host-wide CPU and load
--network=hostReaches the notifiers through the host's network
-v /sys:/sys:roRead-only access to the kernel's hwmon sensors and thermal zones
-v /dev:/dev:roDevice access for disk stats
-v …:/app/tmpPersists the incident history across restarts

Disks in a container

The disk check reads the container's own mount table, so it only sees what's mounted into the container. To watch a host disk, mount it and list its path inside the container:

volumes:
  - /mnt/data:/host/data:ro
environment:
  BABA_DISK_VOLUMES: /,/host/data

Tags

TagWhat
latest, X, X.Y, X.Y.ZStable releases
canary, X.Y.Z-canary.NBuilds of main between releases

What doesn't work in Docker

  • baba install, baba restart, baba uninstall and baba update: the container's restart policy is the service, and a new image is the update.
  • baba logs: use docker logs -f baba.
  • The GPU check needs nvidia-smi inside the container. The image is Alpine (musl), and NVIDIA's container toolkit mounts a glibc build of it, so expect the GPU check to find nothing.

This guide lives in the project repo: edit it there, and this page follows within a day.