-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 873 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (28 loc) · 873 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
35
36
37
FROM rust:1.98.0 as build-env
LABEL maintainer="yanorei32"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /usr/src
RUN cargo new timed-rs
COPY LICENSE Cargo.toml Cargo.lock /usr/src/timed-rs/
WORKDIR /usr/src/timed-rs
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo install cargo-license && cargo license \
--authors \
--do-not-bundle \
--avoid-dev-deps \
--avoid-build-deps \
--filter-platform "$(rustc -vV | sed -n 's|host: ||p')" \
> CREDITS
RUN cargo build --release
COPY src/ /usr/src/timed-rs/src/
RUN touch src/* && cargo build --release
FROM debian:bookworm-slim
WORKDIR /
COPY --chown=root:root --from=build-env \
/usr/src/timed-rs/CREDITS \
/usr/src/timed-rs/LICENSE \
/usr/share/licenses/timed-rs/
COPY --chown=root:root --from=build-env \
/usr/src/timed-rs/target/release/timed-rs \
/usr/bin/timed-rs
CMD ["/usr/bin/timed-rs"]