-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathbatcher.Dockerfile
More file actions
68 lines (49 loc) · 3.01 KB
/
batcher.Dockerfile
File metadata and controls
68 lines (49 loc) · 3.01 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
65
66
67
68
FROM ghcr.io/yetanotherco/aligned_layer/aligned_base:latest AS base
COPY go.mod .
COPY go.sum .
COPY crates/batcher/go_verifiers_lib/verifier.go /aligned_layer/crates/batcher/go_verifiers_lib/verifier.go
RUN apt update -y && apt install -y gcc
RUN go build -buildmode=c-archive -o libverifier.a /aligned_layer/crates/batcher/go_verifiers_lib/verifier.go
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
FROM chef AS planner
COPY crates/sdk/Cargo.toml /aligned_layer/crates/sdk/Cargo.toml
COPY crates/sdk/src/lib.rs /aligned_layer/crates/sdk/src/lib.rs
COPY crates/batcher/Cargo.toml /aligned_layer/crates/batcher/Cargo.toml
COPY crates/batcher/src/main.rs /aligned_layer/crates/batcher/src/main.rs
WORKDIR /aligned_layer/crates/batcher/
RUN cargo chef prepare --recipe-path /aligned_layer/crates/batcher/recipe.json
COPY crates/cli/Cargo.toml /aligned_layer/crates/cli/Cargo.toml
COPY crates/cli/src/main.rs /aligned_layer/crates/cli/src/main.rs
WORKDIR /aligned_layer/crates/cli/
RUN cargo chef prepare --recipe-path /aligned_layer/crates/cli/recipe.json
FROM chef AS chef_builder
COPY crates/sdk/ /aligned_layer/crates/sdk/
COPY --from=planner /aligned_layer/crates/batcher/recipe.json /aligned_layer/crates/batcher/recipe.json
WORKDIR /aligned_layer/crates/batcher
RUN cargo chef cook --release --recipe-path /aligned_layer/crates/batcher/recipe.json
COPY --from=planner /aligned_layer/crates/cli/recipe.json /aligned_layer/crates/cli/recipe.json
WORKDIR /aligned_layer/crates/cli/
RUN cargo chef cook --release --recipe-path /aligned_layer/crates/cli/recipe.json
FROM base AS builder
COPY . /aligned_layer/
COPY --from=chef_builder /aligned_layer/crates/batcher/target/ /aligned_layer/crates/batcher/target/
WORKDIR /aligned_layer/crates/batcher/
RUN cargo build --manifest-path /aligned_layer/crates/batcher/Cargo.toml --release
COPY --from=chef_builder /aligned_layer/crates/cli/target/ /aligned_layer/crates/cli/target/
WORKDIR /aligned_layer/crates/cli/
RUN cargo build --manifest-path /aligned_layer/crates/cli/Cargo.toml --release
COPY scripts/test_files/gnark_groth16_bn254_infinite_script/ /aligned_layer/scripts/test_files/gnark_groth16_bn254_infinite_script/
WORKDIR /aligned_layer
RUN go build -o /aligned_layer/gnark_groth16_bn254_infinite_script scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go
RUN rm -rf operator/
FROM debian:bookworm-slim AS final
COPY --from=builder /aligned_layer /aligned_layer
COPY --from=builder /aligned_layer/crates/target/release/aligned-batcher /usr/local/bin/
COPY --from=builder /aligned_layer/crates/target/release/aligned /usr/local/bin/
COPY --from=builder /aligned_layer/gnark_groth16_bn254_infinite_script /usr/local/bin
COPY ./contracts/script ./contracts/script
COPY ../scripts/test_files/ ./scripts/test_files
COPY ./config-files/config-batcher-docker.yaml ./config-files/
COPY ./config-files/anvil.batcher.ecdsa.key.json ./config-files/
RUN apt update -y && apt install -y libssl-dev ca-certificates
CMD ["aligned-batcher", "--config", "./config-files/config-batcher-docker.yaml"]