-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.Dockerfile
38 lines (23 loc) · 983 Bytes
/
test.Dockerfile
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
38
# This Dockerfile builds the cargo-skeleton package using itself.
# To bootstrap you need to build the cargo-skeleton image first:
# docker build -t cargo-skeleton:latest .
# Then you can build this image:
# docker build -f ./test.Dockerfile .
FROM docker.io/rust:1.80.1-slim-bookworm AS base
ENV CARGO_INCREMENTAL=0
WORKDIR /usr/src/cargo-skeleton
FROM base AS skeleton-builder
COPY --from=cargo-skeleton:latest /cargo-skeleton /usr/local/cargo/bin/
COPY . .
ENV RUST_LOG=debug
RUN cargo skeleton create
FROM base AS builder
COPY --from=cargo-skeleton:latest /cargo-skeleton /usr/local/cargo/bin/
COPY --from=skeleton-builder /usr/src/cargo-skeleton/skeleton.tar /usr/src/cargo-skeleton/skeleton.tar
RUN cargo skeleton unpack
RUN cargo skeleton build -- --release --locked
COPY . .
# Uncomment to debug cargo cache fingerprinting issues
# ENV CARGO_LOG=cargo::core::compiler::fingerprint=trace
RUN cargo build --release --locked
ENTRYPOINT ["cargo", "run" "--"]