-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 757 Bytes
/
Dockerfile
File metadata and controls
34 lines (27 loc) · 757 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:1.85 AS chef
RUN apt-get update && apt-get install -y \
build-essential \
libclang-dev \
libc6 \
libssl-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN cargo install cargo-chef
WORKDIR /reec
FROM chef AS planner
COPY . .
# Determine the crates that need to be built from dependencies
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /reec/recipe.json recipe.json
# Build dependencies only, these remained cached
RUN cargo chef cook --release --recipe-path recipe.json
# Optional build flags
ARG BUILD_FLAGS=""
COPY . .
RUN cargo build --release $BUILD_FLAGS
FROM ubuntu:24.04
WORKDIR /usr/local/bin
COPY --from=builder reec/target/release/reec .
EXPOSE 8545
ENTRYPOINT [ "./reec" ]