I have a large scale java application with 5 Main methods in different classes. I want to run this application as a docker container. From DockerHub OpenJDK Image, I started my Dockerfile as follows
FROM openjdk:latest
COPY . /usr/src/APP
WORKDIR /usr/src/APP`
and I want to add the lines to run the main methods. Without Docker, I run the app using the below lines
echo 'Starting App'
nohup $JAVA_HOME/bin/java .:./App.jar path.to.main.class1 >>
/path/to/nohup/nohup.out 2>&1 &
nohup $JAVA_HOME/bin/java .:./App.jar path.to.main.class2 >>
/path/to/nohup/nohup.out 2>&1 &
nohup $JAVA_HOME/bin/java .:./App.jar path.to.main.class3 >>
/path/to/nohup/nohup.out 2>&1 &
nohup $JAVA_HOME/bin/java .:./App.jar path.to.main.class4 >>
/path/to/nohup/nohup.out 2>&1 &
nohup $JAVA_HOME/bin/java .:./App.jar path.to.main.class5 >>
/path/to/nohup/nohup.out 2>&1 &
echo 'App Started Successfully'`
Is it possible to run the above scenario in one docker container? If possible, how can it be done while there can only be one ENTRYPOINT
and CMD
instructions in a Dockerfile ?