
The root cause of glibc version mismatch (#60) is we're trying to
build on bookworm and run on bullseye. The proper fix is simply
aligning the distro version during multi-stage builds.
While it's okay to statically link against musl libc, I don't see
any benefits in doing so, which _might_ also introduce performance
regressions.
Switch to smaller "distroless" image while we're at it.
This partially reverts commit dc6f9b5ec6
.
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
15 lines
357 B
Docker
15 lines
357 B
Docker
FROM rust:1-slim-bookworm AS builder
|
|
|
|
RUN apt update && apt install -y libclang-dev
|
|
|
|
COPY . /sources
|
|
WORKDIR /sources
|
|
RUN cargo build --release
|
|
RUN chown nobody:nogroup /sources/target/release/bin
|
|
|
|
FROM gcr.io/distroless/cc-debian12
|
|
COPY --from=builder /sources/target/release/bin /pastebin
|
|
|
|
USER nobody
|
|
EXPOSE 8000
|
|
ENTRYPOINT ["/pastebin", "0.0.0.0:8000"]
|