0

I see following warning when my Spring Boot App running in Amazon Corretto Docker container-

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]
DjaouadNM
  • 22,013
  • 4
  • 33
  • 55
Kunal Patil
  • 745
  • 1
  • 9
  • 18

1 Answers1

0

Snippet of my 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

The above commands added in Dockerfile worked for me. Thanks to following resources which helped me find out the commands to add to Dockerfile:

How to install Apache Tomcat Native library

Find out where JAVA is

Tomcat Native / OpenSSL in Spring Boot 2.0

I have not run tests to compare the results to see if any improvements yet.

Kunal Patil
  • 745
  • 1
  • 9
  • 18