I have a spring boot application which contains a Main Class. I have Docker File as below:
FROM docker.io/openjdk:11-jre-slim
EXPOSE 8082
EXPOSE 8443
ADD target/base-application.jar app.jar
ENV JAVA_OPTS=""
ENTRYPOINT exec java $JAVA_OPTS -Dspring.profiles.active=prod -jar /app.jar
I am creating a Docker image by using this Docker file. Let's consider that this docker file is Docker1.
I have another Spring Boot application (which doesn't have a Main class) with Docker file as below:
FROM Docker1:0.0.1
EXPOSE 8443
ADD target/child-application.jar app.jar
ENV JAVA_OPTS=""
ENTRYPOINT exec java $JAVA_OPTS -Dspring.profiles.active=dev -jar /app.jar
I am using Docker1 as a base image for the docker image of 2nd application. When I am trying to run 2nd docker image, I am getting an error "no main manifest attribute, in /app.jar". Can you please help me to run the Main class of Docker1 by running 2nd Docker image?