forked from matter-labs/zksync-os-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (46 loc) · 1.95 KB
/
Copy pathDockerfile
File metadata and controls
64 lines (46 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# syntax=docker/dockerfile:1.6
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
COPY rust-toolchain.toml rust-toolchain.toml
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --bin zksync-os-server --recipe-path recipe.json
FROM chef AS builder
# ---- build-time system libs ----
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libclang-19-dev && \
rm -rf /var/lib/apt/lists/*
ENV LIBCLANG_PATH=/usr/lib/llvm-19/lib
ENV LD_LIBRARY_PATH=${LIBCLANG_PATH}:${LD_LIBRARY_PATH}
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies (this is the caching Docker layer)
RUN cargo chef cook --bin zksync-os-server --release --features gcp --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin zksync-os-server --features gcp
#################################
# -------- Runtime -------------#
#################################
FROM debian:stable-slim
# ---- minimal runtime deps + tini ----
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libssl3 ca-certificates tini && \
rm -rf /var/lib/apt/lists/*
ARG UID=10001
RUN useradd -m -u ${UID} app && \
mkdir -p /db && chown -R app:app /db
# ---- copy binary + genesis.json ----
COPY --from=builder /app/target/release/zksync-os-server /usr/local/bin/
COPY --from=builder /app/local-chains/v31.0/default/genesis.json /app/local-chains/v31.0/default/genesis.json
# Chains that were genesis'd on v30.2 still need the original genesis input (e.g. a fresh
# external-node sync).
COPY --from=builder /app/local-chains/v30.2/default/genesis.json /app/local-chains/v30.2/default/genesis.json
USER app
WORKDIR /app
ENV general_rocks_db_path=/db/node1
ENV prover_api_proof_storage_path=/db/fri_proofs/
EXPOSE 3050 3124 3312 3060
VOLUME ["/db"]
ENTRYPOINT ["/usr/bin/tini", "--", "zksync-os-server"]
LABEL org.opencontainers.image.title="zksync-os-server"