FROM openjdk:8
LABEL maintainer="test"
EXPOSE 8080
ADD test-demo.jar assembly.jar
ENTRYPOINT ["java","-jar","assembly.jar"]
The container i start with this docker file exits soon after it starts. Please advice what to do to keep this running.
FROM openjdk:8
LABEL maintainer="test"
EXPOSE 8080
ADD test-demo.jar assembly.jar
ENTRYPOINT ["java","-jar","assembly.jar"]
The container i start with this docker file exits soon after it starts. Please advice what to do to keep this running.
You need to make sure a java -jar assembly.jar
will keep being active as a foreground process, or said main process would exit, and with it the docker container itself.
You should wrap the java -jar
call in its own script, which allows various ways to keep that script alive, as described here.