-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (26 loc) · 860 Bytes
/
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
FROM gcr.io/distroless/cc
LABEL maintainer "sksat <[email protected]>"
FROM ghcr.io/sksat/cargo-chef-docker:1.63.0-slim-bullseye as chef
WORKDIR /build
FROM chef as planner
COPY Cargo.toml .
COPY Cargo.lock .
COPY src .
RUN cargo chef prepare --recipe-path recipe.json
# build
FROM chef as builder
RUN apt-get update && apt-get install -y --no-install-recommends libdbus-1-dev pkg-config
COPY --from=planner /build/recipe.json recipe.json
COPY Cargo.toml .
COPY Cargo.lock .
COPY src/ src/
# build deps(cached)
RUN cargo chef cook --release --recipe-path recipe.json
# build bin
RUN cargo build --release
#FROM gcr.io/distroless/cc
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y --no-install-recommends libdbus-1-dev bluez
WORKDIR /app
COPY --from=builder /build/target/release/btwattch2-collector /app/
CMD ["/app/btwattch2-collector"]