简体   繁体   English

如何解决 docker OCI 运行时创建失败的启动容器进程导致“exec:\”java\“:$PATH 中找不到可执行文件”:

[英]How to solve docker OCI runtime create failed starting container process caused “exec: \”java\“: executable file not found in $PATH”:

Below is my Dockerfile-下面是我的 Dockerfile-

FROM centos从 centos

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

ENV PATH $PATH:/home/jovyan/work/myprojects/jdk-11.0.7/bin环境路径 $PATH:/home/jovyan/work/myprojects/jdk-11.0.7/bin

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

EXPOSE 9081暴露 9081

ENTRYPOINT ["java", "-jar", "CatalogModel-1.0.jar"]入口点 ["java", "-jar", "CatalogModel-1.0.jar"]


CatalogModel-1.0.jar is my springboot application jar file CatalogModel-1.0.jar是我的springboot应用jar文件

instead of adding jdk file in Dockerfile using ADD command而不是使用 ADD 命令在 Dockerfile 中添加 jdk 文件

Using Below command,i am creating an image使用下面的命令,我正在创建一个图像

docker build -f Dockerfile -t catalogmodelimage. docker build -f Dockerfile -t 目录模型图像。

i am trying to use bind mount the jdk file using below command,我正在尝试使用以下命令绑定安装 jdk 文件,

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

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. docker:来自守护进程的错误响应:OCI 运行时创建失败:container_linux.go:349:启动容器进程导致“exec:\”java\“:$PATH 中找不到可执行文件”:未知。

在此处输入图像描述

Why do you don't use a java docker image?为什么不使用 java docker 图像?

FROM openjdk:11.0.7

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Docker:OCI 运行时创建失败:container_linux.go:349:启动容器进程导致“exec:\”java\“:$PATH 中找不到可执行文件” - Docker: OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”java\“: executable file not found in $PATH” OCI 运行时创建失败:container_linux.go:349:启动容器进程导致“exec:\\”xxxx\\“:在 $PATH 中找不到可执行文件”:未知 - OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”xxxx\“: executable file not found in $PATH”: unknown OCI 运行时创建失败:container_linux.go:348:启动容器进程导致“exec:\\”-it\\“:在 $PATH 中找不到可执行文件”:未知 - OCI runtime create failed: container_linux.go:348: starting container process caused “exec: \”-it\“: executable file not found in $PATH”:unknown OCI 运行时创建失败:container_linux.go:349:启动容器进程导致“exec:\\”r-base\\“:在 $PATH 中找不到可执行文件”:未知 - OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”r-base\“: executable file not found in $PATH”: unknown 运行 docker 容器时出错:启动容器进程导致“exec:\”python\“:在 $PATH 中找不到可执行文件”:未知 - Error running docker container: starting container process caused "exec: \"python\": executable file not found in $PATH": unknown Docker 启动容器进程导致“exec:\\”arg\\“:在 $PATH 中找不到可执行文件”:未知。 - Docker starting container process caused “exec: \”arg\“: executable file not found in $PATH”: unknown. Docker:启动容器进程导致“exec:\”-n\“:$PATH中找不到可执行文件”:未知 - Docker : starting container process caused “exec: \”-n\“: executable file not found in $PATH”: unknown Docker Go 映像:启动容器进程导致:exec:“app”:在 $PATH 中找不到可执行文件:未知 - Docker Go image: starting container process caused: exec: "app": executable file not found in $PATH: unknown OCI 运行时执行失败:执行失败:container_linux.go:380:启动容器进程导致:执行:<PATH> : - OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: <PATH>: Docker:OCI运行时创建失败:在$ PATH中找不到可执行文件 - Docker : OCI runtime create failed: executable file not found in $PATH
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM