I built a docker container for my jboss application. Container ran in AWS EKS Fargate. I found that OutOfMemory error occurred after the application ran for several minutes. However, it would be fine if the root user is used rather than the created user.
My Dockerfile:
FROM openjdk:8u342-oraclelinux8
ENV WILDFLY_VERSION 11.0.0.Final
ENV JBOSS_HOME /usr/local/jboss_api
ENV HOME /usr/local
RUN groupadd -r jboss && useradd -ms /bin/bash -l -r -g jboss jboss \
&& chown jboss /usr/local
USER jboss
WORKDIR ${HOME}
COPY ./wildfly .
RUN tar -xvf wildfly-$WILDFLY_VERSION.tar.gz
RUN rm ./wildfly-$WILDFLY_VERSION.tar.gz
RUN mv ./wildfly-$WILDFLY_VERSION ./jboss_api \
&& mkdir ${JBOSS_HOME}/standalone/configuration/properties
WORKDIR ${JBOSS_HOME}
COPY ./script ./bin
COPY ./properties ./standalone/configuration
COPY ./configurations/standalone.conf ./bin/standalone.conf
COPY ./ROOT.war ./standalone/deployments/ROOT.war
WORKDIR ${JBOSS_HOME}
CMD ./bin/server.sh start
I figured out there is a memory issue for JVM. Therefore -Xmx2500m is set in java config. -XX:+UnlockExperimentalVMOptions and -XX:+UseCGroupMemoryLimitForHeap are also added by reading some reference articles but the problem still cannot be solved.
Anyone have an idea about this?
Thank you.