-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.operator
40 lines (32 loc) · 1.18 KB
/
Dockerfile.operator
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
FROM --platform=$BUILDPLATFORM rust:1.72.0-bookworm as build
ARG TARGETARCH
WORKDIR /near
COPY rust-toolchain.toml ./rust-toolchain.toml
COPY Cargo.toml Cargo.lock ./
COPY nearx/contract near/contract
RUN rustup show
RUN apt-get update && apt-get install -y \
git \
jq \
make \
bash \
openssl \
libssl-dev \
protobuf-compiler \
pkg-config \
cbindgen
RUN cargo new --bin bin/dummy
RUN cargo new --lib crates/dummylib
RUN cargo new --lib nearx
RUN cargo build --release --bin dummy --config net.git-fetch-with-cli=true
COPY ./ ./
RUN cargo build --release --bin nearx-operator --config net.git-fetch-with-cli=true
RUN ldd target/release/nearx-operator
RUN cp target/release/nearx-operator /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/target/release/nearx-operator /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
ENTRYPOINT ["/usr/local/bin/nearx-operator"]