错误“/lib/x86_64-linux-gnu/libc.so.6:找不到版本‘GLIBC_2.33”

error "/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found"

这是我的 Docker 文件:

FROM ubuntu:20.04
RUN apt-get update && apt-get upgrade -y
RUN apt-get install libssl-dev

RUN apt-get install -y -q build-essential curl
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

WORKDIR /command-agent
COPY . /command-agent
RUN cargo build --release
COPY /command-agent/target/release/command-agent /
EXPOSE 8080
ENTRYPOINT command-agent

它构建成功docker图像但是当我运行那个容器它给出错误:

命令代理:/lib/x86_64-linux-gnu/libc.so.6:未找到版本“GLIBC_2.34”(/command-agent/command-agent 要求)

我不明白,我该如何解决这个问题?

当我避开 /target 目录并且现在使用 ubuntu 20.0421.10 两个版本时,它对我有用。感谢 @Charles Duffy@Herohtar 重要而有用的指导,

FROM ubuntu:21.10
RUN apt-get update && apt-get upgrade -y
RUN apt-get install libssl-dev

RUN apt-get install -y -q build-essential curl
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

WORKDIR /command-agent
COPY ./src/. /command-agent/src/
COPY .env /command-agent/
COPY Cargo.toml /command-agent/
COPY Cargo.lock /command-agent/
RUN cargo build --release

EXPOSE 8080
ENTRYPOINT /command-agent/target/release/command-agent