![](/img/trans.png)
[英]How to install java 8 using dockerfile in python:3.8-slim-buster base image
[英]Build errors when trying to install openjdk-8-jre on python:3.8-slim-buster image
我有一个需要 java 运行时的 python 脚本。 我正在尝试构建一个包含 python 3.8 和 Java 8 的 docker 图像。这是我的 Z36257FB577A72F8CCCF7171
FROM python:3.8-slim-buster
RUN apt-get update && apt-get install -y openjdk-8-jre
WORKDIR /
ADD ./requirements.txt /
ADD ./main.py /
RUN pip install -r requirements.txt
CMD [ "python", "./main.py" ]
但是在构建图像时出现以下错误
docker.errors.BuildError: The command '/bin/sh -c apt-get update && apt-get install -y openjdk-8-jre' returned a non-zero code: 100
我尝试了不同的 python 基本图像,但我得到了同样的错误。 我究竟做错了什么?
package openjdk-8-jre
在 Debian Buster 存储库中不可用。 命令:
RUN apt-get update && apt-get install -y openjdk-8-jre
返回:
[...]
E: Unable to locate package openjdk-8-jre
The command '/bin/sh -c apt-get update && apt-get install -y openjdk-8-jre' returned a non-zero code: 100
您有 2 个选项:
openjdk-11-jre
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.