0

I am trying to deploy my springboot application on a docker. I have created a docker file as follows.

FROM openjdk:8-jre-slim
EXPOSE 8080
RUN mkdir /app
COPY Service.jar /app/Service.jar
ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-Djava.security.egd=file:/dev/./urandom","-jar","/app/Service.jar"]

The dockerfile builds fine but when I run the image it throws the following error: no main manifest attribute, in /app/Service.jar

Service is a java springboot application and has rest endpoints. using gradle as a build tool.

Roddy of the Frozen Peas
  • 14,380
  • 9
  • 49
  • 99
shaitan
  • 1
  • 1
  • Possible duplicate of [Can't execute jar- file: "no main manifest attribute"](https://stackoverflow.com/questions/9689793/cant-execute-jar-file-no-main-manifest-attribute) – Adiii Nov 13 '19 at 07:03
  • my META-INF contains a context.xml which has only one tag – shaitan Nov 13 '19 at 07:09
  • You should be using the `spring-boot-maven-plugin` (assuming you are using maven) to build the jar. If you don't you are missing crucial information, amongst others the properly prepared `MANIFEST.MF` in the `META-INF` directory. – M. Deinum Nov 13 '19 at 11:02

0 Answers0