dockerizing微服务本机映像抛出Java安全异常

时间:2019-06-17 04:13:27

标签: quarkus

我正在尝试创建一个示例微服务,以使用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"]

0 个答案:

没有答案