forked from qltysh/qlty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (24 loc) · 905 Bytes
/
Dockerfile
File metadata and controls
28 lines (24 loc) · 905 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
FROM lukemathwalker/cargo-chef:0.1.72-rust-latest AS chef
WORKDIR /app
FROM chef AS planner
COPY . .
# More on how cargo-chef works:
# https://github.com/LukeMathWalker/cargo-chef?tab=readme-ov-file#benefits-vs-limitations
RUN cargo chef prepare
FROM chef AS builder
COPY --from=planner /app/recipe.json .
# The line compiles dependencies. Since it's before the COPY line
# it will be cached and not re-run unless the dependencies change.
RUN cargo chef cook --release
COPY . .
# The line compiles the application, and will re-run every code change
RUN cargo build --release --bin qlty
RUN mv ./target/release/qlty ./qlty
FROM debian:bookworm-slim AS runtime
RUN apt-get update -yqq && apt-get install -yqq ca-certificates
WORKDIR /app
COPY --from=builder /app/qlty /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/qlty"]
# Example usage:
#
# docker run --rm -it -v "$(pwd):/app" qltysh/qlty metrics --all