0

Below is my dockerfile: When this is running in openshift it uses 8 gigs and maxes out the openshift server. Is the dockerfile my issue. This is running a multi module project with two jar servers and a war file project. So I am running this with the war file on a tomcat server as we do locally.

FROM tomcat:8-jre8
MAINTAINER BPE <user@domain.com>
ENV CATALINA_BASE /usr/local/tomcat
ENV CATALINA_HOME /usr/local/tomcat
ENV CATALINA_TMPDIR /usr/local/tomcat/temp
ENV PATH $PATH:$CATALINA_HOME/bin/
ENV JAVA_ALPINE_VERSION 8.92.14-r0
ENV CLASSPATH /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
ENV JRE_HOME /usr
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV AMQP_HOST 172.30.122.196
ENV RUN_AS_USER rxclaim_rdl_app
ENV APP project
ENV VERSION 1.0
ENV JAVA_OPTS="-Xmx8g -Xms8g -XX:MaxPermSize=1024m"
VOLUME /tmp
RUN rm -rf /usr/local/tomcat/webapps/ROOT
RUN chmod 777 /usr/local/tomcat/webapps
ADD bpeuiweb/target/*.war /usr/local/tomcat/webapps
RUN mv /usr/local/tomcat/webapps/*.war /usr/local/tomcat/webapps/ROOT.war
RUN chmod 777 /usr/local/tomcat/webapps/ROOT.war
RUN chmod +x /usr/local/tomcat/webapps
RUN chmod +x /usr/local/tomcat/webapps/ROOT.war
RUN chmod 777 /usr/local/tomcat/conf
COPY server.xml /usr/local/tomcat/conf

USER root

EXPOSE 8080

ENTRYPOINT ["/usr/local/tomcat/bin/catalina.sh","run"]
CMD ["sleep", "infinity"]
dropkick
  • 23
  • 8
  • I guess this could be related to the Java 8 issue related to "RAM quotas" using Docker on a PaaS, so the following reference would be useful in this case: https://developers.redhat.com/blog/2017/03/14/java-inside-docker – ErikMD Jan 25 '20 at 00:14
  • Also you should merge all your consecutive `RUN` commands in a single one to reduce the number of layers and thereby the size of the image (see also: [Purpose of specifying several UNIX commands in a single RUN instruction in Dockerfile](https://stackoverflow.com/q/59535609/9164010)) – ErikMD Jan 25 '20 at 00:25
  • I have another java program running just a jar and it barely needs a gig. Does this have something to do with Tomcat? @ErikMD – dropkick Jan 25 '20 at 02:26

0 Answers0