Dockerfile: switch back to docker.io/library/rust:alpine image

bincode 2 required Rust 1.85, so our options are to switch to Alpine
edge or to use the rust image. While using the rust image results in a
statically linked binary, this does not actually increase the size of
the image, as we were already using jemalloc, so almost nothing of libc
is actually used.
This commit is contained in:
Matthias Schiffer 2025-03-13 21:11:59 +01:00
parent b1c0f316cb
commit fbdd5ed457
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C

View file

@ -1,7 +1,7 @@
FROM docker.io/library/alpine:latest AS builder FROM docker.io/library/rust:alpine AS builder
WORKDIR /build WORKDIR /build
RUN apk add --no-cache build-base cargo RUN apk add --no-cache build-base tini-static
ARG MINEDMAP_VERSION ARG MINEDMAP_VERSION
@ -9,14 +9,9 @@ COPY . .
RUN cargo build -r RUN cargo build -r
RUN strip target/release/minedmap RUN strip target/release/minedmap
FROM docker.io/library/alpine:latest FROM scratch
RUN addgroup -g 1000 -S minedmap \ COPY --from=builder /sbin/tini-static /build/target/release/minedmap /bin/
&& adduser -S -D -H -u 1000 -h /output -s /sbin/nologin -G minedmap -g minedmap minedmap ENTRYPOINT [ "/bin/tini-static", "--", "/bin/minedmap" ]
RUN apk add --no-cache libgcc tini USER 1000:1000
COPY --from=builder /build/target/release/minedmap /bin/minedmap
ENTRYPOINT [ "/sbin/tini", "--", "/bin/minedmap" ]
USER minedmap:minedmap