构建图像时出现以下错误
Sending build context to Docker daemon 8.724MB
Step 1/2 : FROM bde2020/spark-worker:2.4.5-hadoop2.7
---> ddb1ab6d9850
Step 2/2 : RUN apt-get update -y
---> Running in 99bbfdabe226
/bin/sh: apt-get: not found
The command '/bin/sh -c apt-get update -y' returned a non-zero code: 127
这是 docker 文件FROM bde2020/spark-worker:2.4.5-hadoop2.7
RUN apt-get update -y
最佳答案
该镜像的基本操作系统是Alpine linux。您可以验证自己:
$ docker run --rm -it --entrypoint=cat bde2020/spark-worker:2.4.5-hadoop2.7 /etc/*-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.10.4
PRETTY_NAME="Alpine Linux v3.10"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
cat: can't open '/etc/system-release': No such file or directory
因此,您想使用apt
而不是apk
。
关于docker - Docker镜像-apt get update -y错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63656550/