0

我正在尝试创建一个示例微服务,以使用 smallrye rest 客户端和 resteasy jsonb 扩展从外部源获取数据。来自主机的 runner.jar 工作正常,并且正在从源中检索数据。但是一旦我构建了本地 docker 镜像,问题就开始了。我得到以下错误:

Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1903) at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1886) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1402) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)

我尝试通过传入 ENTRYPOINT 来设置javax.net.ssl.trustStorejavax.net.ssl.trustAnchors变量,并创建自定义 docker 映像以添加 graalvm 分发,如下 Dockerfile:

FROM registry.access.redhat.com/ubi8/ubi-minimal ADD graalvm-ce-linux-amd64-19.0.0.tar.gz / RUN chmod 775 /graalvm-ce-19.0.0 ENV PATH /graalvm-ce-19.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work EXPOSE 8080 ENTRYPOINT ["sh", "-c","./application -Djavax.net.ssl.trustStore=/graalvm-ce-19.0.0/jre/lib/security/cacerts -Djavax.net.ssl.trustAnchors=/graalvm-ce-19.0.0/jre/lib/security/cacerts -Djava.library.path=/graalvm-ce-19.0.0/jre/lib/amd64 -Dquarkus.http.host=0.0.0.0"]
4

0 回答 0