Revert "use static linking in Dockerfile"
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>
This commit is contained in:
parent
dc6f9b5ec6
commit
8d02b31688
1 changed files with 6 additions and 9 deletions
15
Dockerfile
15
Dockerfile
|
@ -1,17 +1,14 @@
|
||||||
FROM rust:1-slim AS builder
|
FROM rust:1-slim-bookworm AS builder
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt update && apt install -y libclang-dev
|
||||||
apt-get install -y libclang-dev musl-tools
|
|
||||||
RUN rustup target add x86_64-unknown-linux-musl
|
|
||||||
|
|
||||||
COPY . /sources
|
COPY . /sources
|
||||||
WORKDIR /sources
|
WORKDIR /sources
|
||||||
# force static linking with target to avoid glibc issues
|
RUN cargo build --release
|
||||||
RUN cargo build --release --target x86_64-unknown-linux-musl
|
RUN chown nobody:nogroup /sources/target/release/bin
|
||||||
RUN chown nobody:nogroup /sources/target/x86_64-unknown-linux-musl/release/bin
|
|
||||||
|
|
||||||
FROM debian:bullseye-slim
|
FROM gcr.io/distroless/cc-debian12
|
||||||
COPY --from=builder /sources/target/x86_64-unknown-linux-musl/release/bin /pastebin
|
COPY --from=builder /sources/target/release/bin /pastebin
|
||||||
|
|
||||||
USER nobody
|
USER nobody
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue