Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker jar not found

Tags:

java

docker

My docker file looks like this:

FROM openjdk:9
VOLUME /tmp
ADD target/myjar-1.0-SNAPSHOT.jar app.jar
ENTRYPOINT [“java”,”-jar”,”/app.jar”]

When I run docker build -t myjar it builds fine.

When I run docker run image I get this error:

/bin/sh: 1: [“java”,”-jar”,”/app.jar”]: not found

I heard this could be a "relative path" issue? I'm not sure how to fix it or where the jar should even reside. I need help debugging this.

like image 727
Syan31 Avatar asked Sep 19 '25 14:09

Syan31


1 Answers

This Error occurs only in Windows 10 . Use below command

$> docker container commit --change='CMD java -jar /tmp/app-name.jar' <container_name> <docker_registry>/app-name:

like image 108
vinod kumar Avatar answered Sep 22 '25 04:09

vinod kumar