当我的 Spring Boot 应用程序在 Amazon Corretto Docker 容器中运行时,我看到以下警告-
o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
最佳答案
我的 Dockerfile
片段:
FROM amazoncorretto:8
RUN yum update -y && yum install -y apr-devel && yum install -y openssl-devel && yum install -y gcc && yum install -y make && yum install -y tar && yum install -y gzip
RUN curl "http://apache.spinellicreations.com/tomcat/tomcat-connectors/native/1.2.23/source/tomcat-native-1.2.23-src.tar.gz" -o ./tomcat-native-1.2.23-src.tar.gz
RUN tar zxf ./tomcat-native-1.2.23-src.tar.gz -C .
RUN cd tomcat-native-1.2.23-src/native/
RUN ./tomcat-native-1.2.23-src/native/configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/lib/jvm/java-1.8.0-amazon-corretto/
RUN make && make install
RUN cp -r /usr/local/apr/lib/* /usr/lib/
.... MORE
在 Dockerfile
中添加的上述命令对我有用。感谢以下资源帮助我找到要添加到 Dockerfile
的命令:
How to install Apache Tomcat Native library
Tomcat Native / OpenSSL in Spring Boot 2.0
我还没有运行测试来比较结果以查看是否有任何改进。
关于spring-boot - The APR based Apache Tomcat Native library was not found on the java.library.path warning in Spring Boot Docker App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57708552/