gpt4 book ai didi

java - Docker 失败,子进程/usr/bin/dpkg 返回错误代码 (1)

转载 作者:行者123 更新时间:2023-12-02 08:36:40 29 4
gpt4 key购买 nike

我在尝试将 JRE 安装到我的 docker 容器中时遇到问题。

我不断收到错误消息;

Processing triggers for libc-bin (2.28-10) ...
Processing triggers for systemd (241-7~deb10u1) ...
Processing triggers for ca-certificates (20190110) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

done.
done.
Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.38.1+dfsg-1) ...
Errors were encountered while processing:
openjdk-11-jre-headless:amd64
openjdk-11-jre:amd64
default-jre
E: Sub-process /usr/bin/dpkg returned an error code (1)

如果我向上滚动构建输出一点,我还会看到以下问题;

Setting up default-jre-headless (2:1.11-71) ...
Setting up openjdk-11-jre-headless:amd64 (11.0.4+11-1~deb10u1) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
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-11-jre-headless:amd64 (--configure):
installed openjdk-11-jre-headless:amd64 package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of openjdk-11-jre:amd64:
openjdk-11-jre:amd64 depends on openjdk-11-jre-headless (= 11.0.4+11-1~deb10u1); however:
Package openjdk-11-jre-headless:amd64 is not configured yet.

dpkg: error processing package openjdk-11-jre:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of default-jre:
default-jre depends on openjdk-11-jre; however:
Package openjdk-11-jre:amd64 is not configured yet.

dpkg: error processing package default-jre (--configure):
dependency problems - leaving unconfigured
Setting up ca-certificates-java (20190405) ...
head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory

我的 Dockerfile 非常简单,但就是行不通

FROM nginx:latest

RUN apt-get update -y && apt-get install -y \
unzip \
wget \
default-jre \
nginx

它看起来正在使用debian buster,任何帮助让它工作的人都将不胜感激。我已经尝试了好几天了。

最佳答案

jre 安装要求服务器上存在 man 文件夹,请尝试以下操作:

FROM nginx:latest

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

RUN apt-get update -y && apt-get install -y \
unzip \
wget \
default-jre \
nginx

关于java - Docker 失败,子进程/usr/bin/dpkg 返回错误代码 (1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58160597/

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