rust-lang / docker-rust

The official Docker images for Rust
436 stars 88 forks source link

`GLIBC_2.29' not found #89

Closed 51yu closed 2 years ago

51yu commented 2 years ago

I was using the recommended dockerfile to build image and run app, all looks good, till upgrade builder image from 1.54 to 1.56 ...

FROM rust:1.56 as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .

FROM debian:buster-slim
RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]

run into

/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by myapp)
sfackler commented 2 years ago

The default tag of 1.56 is now built off of Debian Bullseye which ships a newer glibc. You should upgrade your second base image to debian:bullseye-slim.