From 9e5498e3f2d60927690d7bf9ff236fa631dfc946 Mon Sep 17 00:00:00 2001 From: Fabian Schmidt Date: Mon, 16 Sep 2024 12:38:41 +0200 Subject: [PATCH] Document alternative builder for scratch image --- docker/scratch.Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docker/scratch.Dockerfile b/docker/scratch.Dockerfile index 84c70a3..73b87b8 100755 --- a/docker/scratch.Dockerfile +++ b/docker/scratch.Dockerfile @@ -45,3 +45,32 @@ COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/small-rust ./ USER small-rust:small-rust CMD ["/app/small-rust"] + +#################################################################################################### +## Alternatively use this builder (image size actually bigger) +#################################################################################################### +#FROM rust:1-alpine3.19 AS builder +# +#RUN rustup update nightly; rustup default nightly; +# +## Create appuser +#ENV USER=small-rust +#ENV UID=10001 +# +#RUN adduser \ +# --disabled-password \ +# --gecos "" \ +# --home "/nonexistent" \ +# --shell "/sbin/nologin" \ +# --no-create-home \ +# --uid "${UID}" \ +# "${USER}" +# +#RUN apk add --no-cache musl-dev +# +#WORKDIR /app +# +#COPY ./ /app +# +#RUN cargo build --release +#