docker readlink:unrecognized选项:m

wfypjpf4  于 2023-03-29  发布在  Docker
关注(0)|答案(1)|浏览(153)

我有下面的Dockerfile。

FROM debian:10.7

ARG DEBIAN_FRONTEND=noninteractive

RUN echo "Acquire::http::Proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf.d/50proxy && echo "Acquire::https::Proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf.d/50proxy

# Install coreutils, dialog, apt-utils since busybox seems to lack them
RUN apt-get update && apt-get install -y coreutils diffutils dialog apt-utils

# Update openssl to the latest version
RUN apt-get update && apt-get upgrade -y openssl

# installing jq and envsubst binary, very useful for shell templating
RUN apt-get update && apt-get install -y --no-install-recommends \
    libc6=2.28-10+deb10u2 \
    && apt-get upgrade -y && apt-get install -y jq bash gettext-base openssl ca-certificates && rm -rf /var/lib/apt/lists/*

RUN ls -alt /usr/local/share/ca-certificates/ \
    && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
    && ls -alt /etc/ssl/certs/

RUN update-ca-certificates

RUN echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY \
    && ls -alt /etc/ssl/certs/

RUN echo "export http_proxy=${HTTP_PROXY}" >> /etc/profile.d/proxy.sh && echo "export https_proxy=${HTTPS_PROXY}" >> /etc/profile.d/proxy.sh && echo "export no_proxy=${NO_PROXY}" >> /etc/profile.d/proxy.sh

# Add Tini
COPY files/tini-amd64-0.17.0 /sbin/tini

# Force the installation of the package maintainer's version of the openssl.cnf file
RUN echo 'openssl openssl/cnf note' | debconf-set-selections && \
    apt-get install -y --no-install-recommends openssl=1.1.1d-0+deb10u7 --reinstall -o Dpkg::Options::="--force-confnew"

我已经安装了coreutils,diffutils软件包,认为它缺少了一些东西,但我仍然得到同样的问题。

readlink: unrecognized option: m
BusyBox v1.33.1 () multi-call binary.
Usage: readlink [-fnv] FILE
Display the value of a symlink
    -f  Canonicalize by following all symlinks
    -n  Don't add newline
    -v  Verbose
dpkg: error processing archive /var/cache/apt/archives/libc6_2.28-10+deb10u2_amd64.deb (--unpack):
 new libc6:amd64 package pre-installation script subprocess returned error exit status 1

从我在互联网上看到和发现的-m选项在这个版本中不存在。我已经尝试了一些其他的东西,但我不能改为使用-f或其他东西。
有何线索能帮上忙?

k5ifujac

k5ifujac1#

我找到了解决方案。一开始它没有拉出正确的映像,我只需要安装Coreutils,因为看起来BusyBox使用了一个更低调的X1 M0 N1 X版本。
在安装了coreutils并在容器中执行之后,我可以确认readlink-m选项已经存在。

FROM debian:10.7

ENV DEBIAN_FRONTEND=noninteractive

RUN echo "Acquire::http::Proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf.d/50proxy && echo "Acquire::https::Proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf.d/50proxy
# installing jq and envsubst binary, very usefull for shell templating
RUN apt-get update && apt-get upgrade -y && apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y jq bash gettext-base ca-certificates coreutils && rm -rf /var/lib/apt/lists/*

COPY certs/* /usr/local/share/ca-certificates/
RUN update-ca-certificates
RUN echo "export http_proxy=${HTTP_PROXY}" >> /etc/profile.d/proxy.sh && echo "export https_proxy=${HTTPS_PROXY}" >> /etc/profile.d/proxy.sh && echo "export no_proxy=${NO_PROXY}" >> /etc/profile.d/proxy.sh

# Add Tini
COPY files/tini-amd64-0.17.0 /sbin/tini

这是更新后的Dockerfile,也许它可以帮助其他人解决类似的问题。

相关问题