-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (20 loc) · 699 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (20 loc) · 699 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
FROM rust:1-bookworm AS builder
WORKDIR /app
# Cache dependencies first.
COPY Cargo.toml Cargo.lock ./
COPY crates/floe-core/Cargo.toml crates/floe-core/Cargo.toml
COPY crates/floe-cli/Cargo.toml crates/floe-cli/Cargo.toml
RUN cargo fetch --locked
# Copy the full source and build.
COPY crates crates
RUN cargo build -p floe-cli --release --locked
FROM debian:bookworm-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --shell /usr/sbin/nologin floe
WORKDIR /work
COPY --from=builder /app/target/release/floe /usr/local/bin/floe
USER floe
ENTRYPOINT ["floe"]
CMD ["--help"]