* fix(obs): use seconds-scale buckets for HTTP durations Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * perf(obs): reduce HTTP duration histogram bucket overhead Keep the 2–3 ms interval and long-stream range with 16 finite bounds. Match the three instrument names directly in the existing view. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix: restore authorization and storage test invariants Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix(notify): keep rule engine storage calls behind boundary Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix: satisfy current CI architecture and clippy guards Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> --------- Signed-off-by: Hauser Zhi <housemecn@gmail.com> Co-authored-by: heihutu <heihutu@gmail.com> Co-authored-by: zhi22915 <qiuzgang@gmail.com>
RustFS Docker Infrastructure
This directory contains the complete Docker infrastructure for building, deploying, and monitoring RustFS. It provides ready-to-use configurations for development, testing, and production-grade observability.
📂 Directory Structure
| Directory | Description | Status |
|---|---|---|
observability/ |
[RECOMMENDED] Full-stack observability (Prometheus, Grafana, Tempo, Loki). | ✅ Production-Ready |
compose/ |
Specialized setups (e.g., 4-node distributed cluster testing). | ⚠️ Testing Only |
mqtt/ |
EMQX Broker configuration for MQTT integration testing. | 🧪 Development |
openobserve-otel/ |
Alternative lightweight observability stack using OpenObserve. | 🔄 Alternative |
📄 Root Directory Files
The following files in the project root are essential for Docker operations:
Build Scripts & Dockerfiles
| File | Description | Usage |
|---|---|---|
docker-buildx.sh |
Multi-Arch Build Script Automates building and pushing Docker images for amd64 and arm64. Supports release and dev channels. |
./docker-buildx.sh --push |
Dockerfile |
Production Image (Alpine) Lightweight image using musl libc. Downloads verified RustFS and rc binaries from GitHub Releases and bundles /etc/rustfs/bootstrap. |
docker build -t rustfs:latest . |
Dockerfile.glibc |
Production Image (Ubuntu) Standard image using glibc. Includes the bundled bootstrap configuration. |
docker build -f Dockerfile.glibc . |
Dockerfile.source |
Development Image Builds RustFS from source code and bundles rc and the default bootstrap configuration. |
docker build -f Dockerfile.source . |
Docker Compose Configurations
| File | Description | Usage |
|---|---|---|
docker-compose.yml |
Main Development Setup Comprehensive setup with profiles for development, observability, and proxying. |
docker compose up -ddocker compose --profile observability up -d |
docker-compose-simple.yml |
Quick Start Setup Minimal configuration running a single RustFS instance with 4 volumes. Perfect for first-time users. |
docker compose -f docker-compose-simple.yml up -d |
🌟 Observability Stack (Recommended)
Located in: .docker/observability/
We provide a comprehensive, industry-standard observability stack designed for deep insights into RustFS performance. This is the recommended setup for both development and production monitoring.
Components
- Metrics: Prometheus (Collection) + Grafana (Visualization)
- Traces: Tempo (Storage) + Jaeger (UI)
- Logs: Loki
- Ingestion: OpenTelemetry Collector
Key Features
- Full Persistence: All metrics, logs, and traces are saved to Docker volumes, ensuring no data loss on restarts.
- Correlation: Seamlessly jump between Logs, Traces, and Metrics in Grafana.
- High Performance: Optimized configurations for batching, compression, and memory management.
Quick Start
cd .docker/observability
docker compose up -d
🧪 Specialized Environments
Located in: .docker/compose/
These configurations are tailored for specific testing scenarios that require complex topologies.
Distributed Cluster (4-Nodes)
Simulates a real-world distributed environment with 4 RustFS nodes running locally.
docker compose -f .docker/compose/docker-compose.cluster.yaml up -d
Integrated Observability Test
A self-contained environment running 4 RustFS nodes alongside the full observability stack. Useful for end-to-end testing of telemetry.
docker compose -f .docker/compose/docker-compose.observability.yaml up -d
📡 MQTT Integration
Located in: .docker/mqtt/
Provides an EMQX broker for testing RustFS MQTT features.
Quick Start
cd .docker/mqtt
docker compose up -d
- Dashboard: http://localhost:18083 (Default:
admin/public) - MQTT Port:
1883
👁️ Alternative: OpenObserve
Located in: .docker/openobserve-otel/
For users preferring a lightweight, all-in-one solution, we support OpenObserve. It combines logs, metrics, and traces into a single binary and UI.
Quick Start
cd .docker/openobserve-otel
docker compose up -d
Docker Compose environment values
Use map syntax when quoting environment values in YAML:
services:
rustfs:
image: rustfs/rustfs:latest
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./data:/data
- ./logs:/var/log/rustfs
environment:
RUSTFS_ADDRESS: ":9000"
RUSTFS_CONSOLE_ADDRESS: ":9001"
RUSTFS_CONSOLE_ENABLE: "true"
RUSTFS_OBS_LOGGER_LEVEL: error
RUSTFS_OBS_LOG_DIRECTORY: "/var/log/rustfs/"
RUSTFS_ACCESS_KEY: "${RUSTFS_ACCESS_KEY:?Set RUSTFS_ACCESS_KEY}"
RUSTFS_SECRET_KEY: "${RUSTFS_SECRET_KEY:?Set RUSTFS_SECRET_KEY}"
Create the host directories and grant the container user write access before starting this example; official images run as UID/GID 10001:10001. Set both credential variables to your own values, then run docker compose config to inspect the resolved configuration locally before docker compose up -d. The resolved output includes credentials, so do not share it publicly.
With list syntax, use - RUSTFS_OBS_LOG_DIRECTORY=/var/log/rustfs/ or quote the whole item as - "RUSTFS_OBS_LOG_DIRECTORY=/var/log/rustfs/". Writing - RUSTFS_OBS_LOG_DIRECTORY="/var/log/rustfs/" passes the inner quotes literally, making this a relative path beginning with ", which can fail with mkdir: cannot create directory '"': Permission denied. This also applies to addresses and credentials: fix every affected list item, rather than only the log directory. The entrypoint preserves configured values, including literal quotes in valid paths and secrets.
Local storage pool expansion
To append a second four-drive pool, set RUSTFS_VOLUMES: "/data/rustfs0/{0...3} /data/rustfs1/{0...3}" and keep the original pool's drives, order, and erasure set width. The container prepares each drive directory and passes one argument per pool to RustFS.
If an older image already formatted both ranges together as a single eight-drive pool, list the eight individual paths in their original order to keep that layout when upgrading.
🔧 Common Operations
Cleaning Up
To stop all containers and remove volumes (WARNING: deletes all persisted data):
docker compose down -v
Viewing Logs
To follow logs for a specific service:
docker compose logs -f [service_name]
Checking Status
To see the status of all running containers:
docker compose ps