@@ -33,19 +33,37 @@ RUN apt-get update && apt-get install -y cmake protobuf-compiler
33
33
# Install protobuf for elixir
34
34
RUN mix escript.install --force hex protobuf
35
35
36
+ # Download openapi spec
37
+ COPY Makefile .oapi_version /consensus/
38
+ RUN make download-beacon-node-oapi
39
+
36
40
# Install rust
37
41
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
38
42
39
43
ENV PATH="${PATH}:/root/.cargo/bin:/root/.mix/escripts"
40
44
45
+ # Precompile rust crates. Rustler stores targets under _build
46
+ COPY ./native /consensus/native
47
+ RUN cd /consensus/native/bls_nif && cargo build --release \
48
+ --target-dir="/consensus/_build/prod/lib/lambda_ethereum_consensus/native/bls_nif"
49
+ RUN cd /consensus/native/kzg_nif && cargo build --release \
50
+ --target-dir="/consensus/_build/prod/lib/lambda_ethereum_consensus/native/kzg_nif"
51
+ RUN cd /consensus/native/snappy_nif && cargo build --release \
52
+ --target-dir="/consensus/_build/prod/lib/lambda_ethereum_consensus/native/snappy_nif"
53
+ RUN cd /consensus/native/ssz_nif && cargo build --release \
54
+ --target-dir="/consensus/_build/prod/lib/lambda_ethereum_consensus/native/ssz_nif"
55
+
56
+ # Precompile elixir dependencies
57
+ COPY mix.exs mix.lock .fork_version ./
58
+ COPY ./config/config.exs /consensus/config/config.exs
59
+ RUN mix deps.get
60
+ RUN mix deps.compile
61
+
41
62
COPY . .
42
63
COPY --from=libp2p_builder /libp2p_port/libp2p_port /consensus/priv/native/libp2p_port
43
64
44
65
RUN protoc --elixir_out=./lib proto/libp2p.proto
45
66
46
- RUN make download-beacon-node-oapi
47
-
48
- RUN mix deps.get
49
67
RUN mix compile
50
68
51
69
ENTRYPOINT [ "iex" , "-S" , "mix" , "run" , "--" ]
0 commit comments