builder stage compiles the binary with GCC; the runtime stage runs it on a minimal debian:bookworm-slim base, keeping the final image small.
Initial deploy
Create a named volume
RadishDB writes all data to
/app/aof/radish.aof. Create a named volume so the file persists independently of the container:Data lives at
/app/aof/radish.aof inside the container. Mounting a named volume at /app/aof is the recommended way to make writes durable across container lifecycle events.Run the container
Start RadishDB with port mapping and volume mount:Flag breakdown:
| Flag | Purpose |
|---|---|
-d | Run in detached (background) mode |
--name radishdb | Assign a stable name for subsequent commands |
-p 6379:6379 | Map host port 6379 to container port 6379 |
-v radish-data:/app/aof | Mount the named volume at the AOF directory |
Volume management
List all volumes and confirmradish-data exists:
Mountpoint field shows where Docker stores the AOF file on the host. You can copy the file out for backup:
Container lifecycle
Stop the container gracefully:How the image is built
TheDockerfile uses a two-stage build:
make. The resulting radishdb binary is the only artifact carried forward.
Stage 2 (runtime): Starts from debian:bookworm-slim — no compiler, no build tools. The binary is copied in, the AOF directory is created, port 6379 is declared, and the default command is --server.
This keeps the final image lean: the GCC layer is discarded and never shipped.
Overriding the startup command
The defaultCMD ["--server"] runs RadishDB in TCP server mode. You can override it at runtime: