docker-exporter
July 7, 2026 ยท View on GitHub
docker-exporter
A tiny Prometheus exporter for Docker container metrics, written in Rust for ARM64 homelabs running cgroup v2 โ and the fix for cAdvisor's zero-memory bug on Raspberry Pi 5.
๐ Full documentation: docker-exporter.tech
cAdvisor reports zero for container_memory_working_set_bytes on Raspberry Pi 5 (ARM64 + cgroup v2) โ a known, upstream-unfixed bug. docker-exporter reads the Docker stats API directly, computes the working set correctly on both cgroup versions, talks to the socket read-only, runs non-root, and idles around 7 MiB of RAM. Metric names are cAdvisor-compatible, so existing Grafana dashboards work unchanged.
Quick start
docker run -d \
--name docker-exporter \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-p 9713:9713 \
--restart unless-stopped \
ghcr.io/dlepaux/docker-exporter:latest
Then scrape http://localhost:9713/metrics. Image is published for linux/amd64 and linux/arm64.
Why docker-exporter
- Correct memory working set on cgroup v1 and v2 (
usage โ inactive_fileon v2,usage โ cacheon v1) โ the number cAdvisor zeroes on ARM64. - ~9 MB image, ~7 MiB RAM, < 1% CPU โ a single static binary on distroless.
- Read-only Docker socket, non-root (UID 65532), no privileged mode.
- On-demand collection โ no background loop; 5 s per-container timeout.
- Per-container CPU, memory, network, block I/O, state, health, and lifecycle metrics.
- Glob-aware container exclusion via
EXCLUDE_CONTAINERS.
Documentation
Everything lives at docker-exporter.tech:
- Installation ยท Configuration ยท Metrics reference
- Prometheus & Grafana ยท Architecture ยท Troubleshooting
- Why cAdvisor breaks on Raspberry Pi 5 ยท docker-exporter vs cAdvisor
Development
cargo build # debug build
cargo test # unit + integration tests (some need a local Docker daemon)
cargo clippy # lints
cargo fmt # format (CI enforces `cargo fmt --check`)
cargo build --release # release binary
Tests that need a Docker daemon skip themselves when the socket isn't reachable, so cargo test is safe to run anywhere.
Security
Found a vulnerability? Follow the disclosure policy in SECURITY.md โ please do not open a public issue.