-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.offchain
33 lines (28 loc) · 1022 Bytes
/
Dockerfile.offchain
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
FROM --platform=$BUILDPLATFORM rust:1.72.0-bookworm as build
WORKDIR /near
ARG TARGETARCH
COPY rust-toolchain.toml ./rust-toolchain.toml
RUN rustup show
RUN apt-get update && apt-get install -y \
git \
jq \
make \
bash \
openssl \
libssl-dev \
protobuf-compiler \
pkg-config \
cbindgen
COPY ./ ./
RUN cargo build --release --config net.git-fetch-with-cli=true
RUN ldd target/release/near-light-client
RUN cp target/release/near-light-client /near/near-light-client
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y openssl libssl-dev pkg-config ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=build /near/near-light-client /usr/local/bin
COPY --from=build /near/config.toml /var/near-light-client/config.toml
ENV NEAR_LIGHT_CLIENT_DIR=/var/near-light-client
ENV NEAR_LIGHT_CLIENT_CONFIG_FILE=/var/near-light-client/config.toml
ENV NEAR_LIGHT_CLIENT_MODE=default
RUN ldd /usr/local/bin/near-light-client
ENTRYPOINT ["/usr/local/bin/near-light-client"]