forked from fleek-network/ursa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 819 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (26 loc) · 819 Bytes
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
FROM rust:latest as builder
ARG PROFILE=release
WORKDIR /ursa
RUN apt-get update && apt-get install -y \
clang \
cmake \
libclang-dev \
protobuf-compiler
RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo install cargo-strip
COPY . .
ENV RUST_BACKTRACE=1
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/ursa/target \
cargo build --profile $PROFILE --bin ursa \
&& cargo strip \
&& mv /ursa/target/release/ursa /ursa/
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
&& apt-get clean \
&& apt-get purge -y \
&& rm -rf /var/lib/apt/lists*
# Get compiled binaries from builder's cargo install directory
COPY --from=builder /ursa/ursa /usr/local/bin
ENTRYPOINT ["ursa"]