mabel/Dockerfile

34 lines
512 B
Text
Raw Permalink Normal View History

2023-07-05 13:14:01 +00:00
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"]