Docker Builds
Docker builds compile base/base reproducibly without a host Rust toolchain. The repository ships several Dockerfiles under etc/docker/ for the client, builder, devnet, and websocket proxy.
Available Dockerfiles
Section titled “Available Dockerfiles”| File | Purpose |
|---|---|
etc/docker/Dockerfile.client | Production client image containing base-reth-node |
etc/docker/Dockerfile.builder | Builder image used as a base for multi-stage builds |
etc/docker/Dockerfile.devnet | Devnet-specific image for local development networks |
etc/docker/Dockerfile.websocket-proxy | Standalone websocket proxy image |
Building the Client Image
Section titled “Building the Client Image”From the repository root, build the production client image:
docker build -t base-reth-node -f etc/docker/Dockerfile.client .This performs a multi-stage build: it compiles the Rust binary inside a builder container and copies the resulting binary into a minimal runtime image. The build context is the repository root, so all workspace crates are available to the compiler.
Depending on your hardware, the first build may take 15-30 minutes. Subsequent builds benefit from Docker layer caching.
Running the Container
Section titled “Running the Container”Start the node with default settings:
docker run -it --rm base-reth-nodePass CLI options after the image name, exactly as you would with the bare binary:
docker run -it --rm base-reth-node --helpPersisting Data
Section titled “Persisting Data”By default, a container’s filesystem is ephemeral. To persist chain data across restarts, mount a host directory to the node’s data directory:
docker run -it --rm \ -v /path/to/data:/data \ base-reth-node \ --datadir /dataExposing Ports
Section titled “Exposing Ports”The node exposes several network ports. Map them to the host as needed:
docker run -it --rm \ -v /path/to/data:/data \ -p 8545:8545 \ -p 8546:8546 \ -p 30303:30303 \ -p 30303:30303/udp \ base-reth-node \ --datadir /data \ --http \ --http.addr 0.0.0.0 \ --ws \ --ws.addr 0.0.0.0| Port | Protocol | Service |
|---|---|---|
| 8545 | TCP | HTTP JSON-RPC |
| 8546 | TCP | WebSocket JSON-RPC |
| 30303 | TCP + UDP | P2P discovery and communication |
Running in the Background
Section titled “Running in the Background”Use -d instead of -it to run detached:
docker run -d --name base-node \ -v /path/to/data:/data \ -p 8545:8545 \ base-reth-node \ --datadir /data \ --http --http.addr 0.0.0.0
# View logsdocker logs -f base-node
# Stopdocker stop base-nodeBuilding Other Images
Section titled “Building Other Images”Build the websocket proxy image:
docker build -t base-websocket-proxy -f etc/docker/Dockerfile.websocket-proxy .Build the devnet image (typically used by the docker-compose devnet stack rather than run directly):
docker build -t base-devnet -f etc/docker/Dockerfile.devnet .- Layer caching: The Dockerfiles are structured so that dependency fetching is cached separately from source compilation. If you only change Rust source files, the dependency layers are reused.
- BuildKit: Enable BuildKit for faster builds:
DOCKER_BUILDKIT=1 docker build ... - Cross-compilation: If you need an
amd64image on an ARM host (or vice versa), usedocker buildx build --platform linux/amd64 ....
For running a full local devnet with Docker Compose, see Local Devnet. For production Docker deployments, see Node Operations: Docker.