forked from fleek-network/ursa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-gateway
More file actions
37 lines (30 loc) · 1.03 KB
/
Copy pathDockerfile-gateway
File metadata and controls
37 lines (30 loc) · 1.03 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
FROM rust:latest as builder
ARG PROFILE=release
WORKDIR /ursa
RUN apt-get update && apt-get install -y \
clang \
cmake \
libclang-dev \
protobuf-compiler
COPY . .
ENV RUST_BACKTRACE=1
RUN --mount=type=cache,target=/ursa/target \
--mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/local/rustup \
set -eux; \
rustup install stable; \
cargo build --profile $PROFILE --bin ursa-gateway; \
objcopy --compress-debug-sections target/release/ursa-gateway ./ursa-gateway
FROM debian:bullseye-slim
RUN set -eux; \
export DEBIAN_FRONTEND=noninteractive; \
apt-get update; \
apt-get install --yes --no-install-recommends libcurl4-openssl-dev curl ca-certificates htop; \
apt-get clean autoclean; \
apt-get autoremove --yes; \
rm -rf /var/lib/{apt,dpkg,cache,log}/
WORKDIR ursa
# Get compiled binaries from builder's cargo install directory
COPY --from=builder /ursa/ursa-gateway ./
CMD ["./ursa-gateway", "daemon"]