Docker Community Forums

Share and learn in the Docker community.

How to solve docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"java\": executable file not found in $PATH": unknown

Below is my Dockerfile-

FROM centos

ENV JAVA_HOME /home/jovyan/work/myprojects/jdk-11.0.7

ENV PATH $PATH:/home/jovyan/work/myprojects/jdk-11.0.7/bin

ADD build/libs/CatalogModel-1.0.jar CatalogModel-1.0.jar

EXPOSE 9081

ENTRYPOINT [“java”, “-jar”, “CatalogModel-1.0.jar”]

CatalogModel-1.0.jar is my springboot application jar file

instead of adding jdk file in Dockerfile using ADD command

Using Below command,i am creating an image

docker build -f Dockerfile -t catalogmodelimage .

i am trying to use bind mount the jdk file using below command,

docker run -p 9081:9081 --mount type=bind,source=C:/Docker/jdk-11.0.7,target=/home/jovyan/work/myprojects catalogmodelimage

But when i execute the above command,i get this error

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused “exec: “java”: executable file not found in $PATH”: unknown.