Springboot app, deploy failed

Hello everybody, i’m trying to deploy an springboot app in a docker container. I tried several times, but it does’t work, my dockerfile is that way :

FROM amazoncorretto:17-alpine-jdk
COPY /out/artifacts/agilstratApi_jar agilstratApi.jar
ENTRYPOINT [“java”, “-jar”, “agilstratApi.jar”]

the log return me this error:

Error: Invalid or corrupt jarfile agilstratApi.jar

i tried rebuild my app on local, and updating my github repo… but nothings change, i always have that error message! i have searched up in google and found no answer, any idea or tip to solve ir?

thanks a lot!

Your built JAR has no extension specified in the source directory. Did you mean to use a period (.) instead of an underscore (_)?

COPY /out/artifacts/agilstratApi_jar agilstratApi.jar

You’d likely want to use

COPY /out/artifacts/agilstratApi.jar agilstratApi.jar

Thanks for reply me!
It has an underscore because it’s a directory name.

I have tried to run the jar file on local and its fail too!

So that’s the problem! App not start from jar file!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.