gpt4 book ai didi

java -/usr/bin/dpkg 在 python :3. 7-slim-stretch 上返回错误代码 (1)

转载 作者:行者123 更新时间:2023-11-30 05:26:22 26 4
gpt4 key购买 nike

嗨,我需要使用 java 构建 python:3.7-slim-stretch docker 镜像

这是我的 Dockerfile:

FROM python:3.7-slim-stretch


# Install OpenJDK-8
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;

# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME

但是当我构建它时我收到此错误:

...
update-alternatives: error: error creating symbolic link '/usr/share/man/man1/rmid.1.gz.dpkg-tmp': No such file or directory
dpkg: error processing package openjdk-8-jre-headless:amd64 (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of ca-certificates-java:


dpkg: error processing package openjdk-8-jdk:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-8-jre:amd64:
openjdk-8-jre:amd64 depends on openjdk-8-jre-headless (= 8u232-b09-1~deb9u1); however:
Package openjdk-8-jre-headless:amd64 is not configured yet.

E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update && apt-get install -y openjdk-8-jdk && apt-get install -y ant && apt-get clean;' returned a non-zero code: 100

有什么想法吗?

谢谢

最佳答案

将其添加到 insatll 之前的 dockerfile 中:

RUN mkdir -p /usr/share/man/man1/

您还可以删除RUN export JAVA_HOME,因为它在 Dockerfile 中没有任何作用

关于java -/usr/bin/dpkg 在 python :3. 7-slim-stretch 上返回错误代码 (1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58503339/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com