An error is reported when starting the springboot project, prompting unablet to access jarfile. How to solve it?

Alibaba cloud Q & A 2022-02-13 06:32:49 阅读数:726

error reported starting springboot project

Docker start-up SpringBoot Project report error , Tips unablet to access jarfile app.jar.

Normal generation docker image, But in docker run It didn't start successfully , Tips unable to access jarfile app.jar( This jar It's mine. springboot Project jar package )

Dockerfile To configure

FROM java:8VOLUME /tmpADD andy-0.0.1-SNAPSHOT.jar app.jarEXPOSE 8081ENTRYPOINT ["java","-jar","~/app.jar"]

What went wrong ?

Take the answer 1:

Hello! ,ADD Give orders to app.jar Put it in docker image Under the root directory of , So your dockerfile It should be written like this

ENTRYPOINT ["java","-jar","/app.jar"]

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you.