-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.client
More file actions
34 lines (25 loc) · 805 Bytes
/
Dockerfile.client
File metadata and controls
34 lines (25 loc) · 805 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
# Use an official Rust runtime as a parent image
FROM rust:1.77-slim as builder
# Create a new empty shell project
#RUN USER=root cargo new --bin client
WORKDIR /client
#install build dependencies
RUN apt update
RUN apt-get -y install protobuf-compiler
# Copy our manifests
COPY . .
#COPY ./Cargo.toml ./Cargo.lock ./src/client/* ./
# This build step will cache your dependencies
RUN cargo build --release
RUN rm src/*.rs
# Now that the dependencies are built, copy your source code
COPY ./src ./src
# Build for release.
RUN rm ./target/release/deps/client*
RUN cargo build --bin client --release
# Final base
FROM debian:bookworm-slim
# Copy the build artifact from the build stage
COPY --from=builder /client/target/release/client .
# Set the startup command to run your binary
CMD ["./client"]