Error: Invalid or corrupt jarfile /app.jar
See original GitHub issueI have setup the following Dockerfile. Everything seems to build fine but getting the error that it is corrupt. I did verify that java 8 is set in the POM and manually executed the jar so I know it is working. The other change is that I moved the Dockerfile to the project root. Docker complains about any type of ../
being used to get a path.
Should this work?
FROM dockerfile/java:oracle-java8
VOLUME /tmp
ADD target/core-0.1.0-RELEASE.jar app.jar
RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=local","/app.jar"]
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Run SpringBoot-based docker image return error message ...
spring boot - Run SpringBoot-based docker image return error message:Invalid or corrupt jarfile /app. jar - Stack Overflow. Stack Overflow for Teams –...
Read more >1798079 – Multistage Docker File - Error: Invalid or corrupt jarfile
Description of problem: I have a Multistage docker file for a spring-boot java application, that when built locally the image runs successfully.
Read more >"Invalid or corrupt jarfile export.jar..." while the export utility
This issue occurs when the Java version installed in your machine is not version 8. Solution.
Read more >Error: Invald or corrupt Jarfile /app.jar : r/docker - Reddit
Is it valid to give a file name as the second parameter instead of a location? COPY ${JAR_FILE} app.jar. Might be worth to...
Read more >Docker Error :Invalid or corrupt jarfile .jar_穿越23小时的博客
他提示的是你的jar包有问题,无效。那么有很多种情况,我遇到的是两种。dockerfile有问题,我的dockerfile一开始是直接网上复制的,其中有一句是将jar ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok, got it to work.
For me when I was having the issue, all I did was put the JAR_FILE argument in the pom without the forward slash “
/
” and it worked.Also my Dockerfile is like below