-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (19 loc) · 770 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (19 loc) · 770 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
# syntax=docker/dockerfile:1
###############################################################
# Builder: builds a statically-linked Rust release binary
###############################################################
FROM rust:1.76-alpine as build
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static
WORKDIR /app
# Copy dependencies
COPY . .
# Build binary
RUN cargo build --release
###############################################################
# Final
###############################################################
# Copy artifacts to a clean image
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /app/target/release/rust_cli_template .
ENTRYPOINT [ "./rust_cli_template" ]