FROM rust:slim AS builder RUN update-ca-certificates ENV USER=mabel ENV UID=10001 RUN adduser \ --disabled-password \ --gecos "" \ --home "/nonexistent" \ --shell "/sbin/nologin" \ --no-create-home \ --uid "${UID}" \ "${USER}" WORKDIR /mabel COPY ./ . RUN cargo build --release FROM gcr.io/distroless/cc COPY --from=builder /etc/passwd /etc/passwd COPY --from=builder /etc/group /etc/group WORKDIR /mabel COPY --from=builder /mabel/target/release/mabel ./ USER mabel:mabel CMD ["/mabel/mabel"]