Skip to content

Commit e464a9e

Browse files
authored
Merge pull request #3 from o1-labs/fix/docker-runtime
fix(deploy): add libssl3 to runtime image (fixes startup crash) + per-network compose
2 parents 30c03f2 + d3185a9 commit e464a9e

2 files changed

Lines changed: 42 additions & 7 deletions

File tree

deploy/Dockerfile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
# Build the Mina light node.
1+
# Build the Mina light node (mina-relay + the mina-verify trust gate).
2+
#
3+
# It compiles mina-verify's recursive-proof verifier (proof-systems / kimchi), which
4+
# needs a C toolchain + openssl at build time and libssl at runtime.
5+
26
FROM rust:1-bookworm AS build
7+
# rust:1-bookworm (buildpack-deps based) already ships these, but be explicit so the
8+
# build can't silently depend on the base image's contents.
9+
RUN apt-get update && apt-get install -y --no-install-recommends \
10+
build-essential pkg-config libssl-dev git ca-certificates \
11+
&& rm -rf /var/lib/apt/lists/*
312
WORKDIR /src
413
COPY . .
5-
RUN cargo build --release -p mina-light-node
14+
RUN cargo build --release --locked -p mina-light-node
15+
RUN strip target/release/mina-light-node
616

717
FROM debian:bookworm-slim
8-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
18+
# libssl3: the binary links openssl dynamically (openssl-sys in the dep tree).
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
ca-certificates libssl3 \
921
&& rm -rf /var/lib/apt/lists/*
1022
COPY --from=build /src/target/release/mina-light-node /usr/local/bin/mina-light-node
23+
# Out of the box: connect to devnet seeds and verify forever, no configuration.
24+
# Switch networks with `-e MINA_NETWORK=mainnet`.
1125
ENV MINA_NETWORK=devnet
26+
ENV RUST_LOG=info
1227
ENTRYPOINT ["mina-light-node"]

deploy/docker-compose.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1-
# Mina light node — joins p2p (mina-relay) + verifies (mina-verify).
2-
# TODO: add the verify sidecar (MinaProtocol/mina-verify mina-verify-server) once
3-
# the trust gate is wired, or run verification in-process.
1+
# Mina light node — joins p2p (mina-relay) + verifies every tip (mina-verify),
2+
# in-process. No sidecar, no configuration.
3+
#
4+
# One process follows exactly ONE network: the libp2p pnet key is derived from the
5+
# chain id, so a devnet swarm cannot even decrypt mainnet traffic, and Mina's network
6+
# config is process-global (set once). So it's one container per network — same image,
7+
# different MINA_NETWORK. Both services below build the same image.
8+
#
9+
# docker compose -f deploy/docker-compose.yml up --build # devnet (default)
10+
# docker compose -f deploy/docker-compose.yml --profile mainnet up # mainnet
411
services:
5-
mina-light-node:
12+
devnet:
13+
image: mina-light-node:latest
614
build:
715
context: ..
816
dockerfile: deploy/Dockerfile
917
environment:
1018
MINA_NETWORK: devnet
1119
RUST_LOG: info
20+
# LIGHT_NODE_SECS unset => run forever.
21+
restart: unless-stopped
22+
23+
mainnet:
24+
image: mina-light-node:latest
25+
profiles: ["mainnet"]
26+
build:
27+
context: ..
28+
dockerfile: deploy/Dockerfile
29+
environment:
30+
MINA_NETWORK: mainnet
31+
RUST_LOG: info
1232
restart: unless-stopped

0 commit comments

Comments
 (0)