Sunday, 8 November 2020

Docker Jar Copy Error

Error: 


Many have faced the following error while configuring the docker in Jenkins. 


COPY failed: stat /var/lib/docker/tmp/docker-builder086957739/C:\Users\Syed\AppData\Local\Jenkins\.jenkins\workspace\GreetUser\GreetUser\target\*.jar: no such file or directory


Error: Invalid or corrupt jarfile /app.jar


Error: Unable to access jarfile target/*.jar


Resolution:


If you come across the above, make sure you have configured like below in the docker file.

FROM openjdk:8-jdk-alpine

RUN addgroup -S spring && adduser -S spring -G spring

USER spring:spring

copy ${workspace}//GreetUser//target//GreetUser-0.0.1-SNAPSHOT.jar /app.jar

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


Happy Finding!!!!

No comments:
Write comments