简体   繁体   English

OCI 运行时执行失败:执行失败:(...)$PATH 中找不到可执行文件“:未知

[英]OCI runtime exec failed: exec failed: (...) executable file not found in $PATH": unknown

I have dockerized an app which has ffmpeg installed in it via libav-tools.我已经通过 libav-tools 对一个安装了 ffmpeg 的应用程序进行了 docker 化。 The app launches without problem, yet the problem occured when fluent-ffmpeg npm module tried to execute ffmpeg command, which was not found.该应用程序启动没有问题,但是当 fluent-ffmpeg npm 模块尝试执行 ffmpeg 命令时出现问题,该命令未找到。 When I wanted to check the version of the ffmpeg and the linux distro set up in the image, I used sudo docker exec -it c44f29d30753 "lsb_release -a" command, but it gave the following error: OCI runtime exec failed: exec failed: container_linux.go:296: starting container process caused "exec: \\"lsb_release -a\\": executable file not found in $PATH": unknown当我想检查图像中设置的 ffmpeg 和 linux 发行版的版本时,我使用了sudo docker exec -it c44f29d30753 "lsb_release -a"命令,但它给出了以下错误: OCI runtime exec failed: exec failed: container_linux.go:296: starting container process caused "exec: \\"lsb_release -a\\": executable file not found in $PATH": unknown

Then I realized that it gives me the same error with all the commands that I try to run inside the image or the container.然后我意识到,我尝试在图像或容器中运行的所有命令都给我同样的错误。

OCI runtime exec failed: exec failed: container_linux.go:296: starting container process caused "exec: \"ffmpeg -a\": executable file not found in $PATH": unknown

This is my Dockerfile:这是我的 Dockerfile:

FROM ubuntu:xenial
FROM node
RUN apt-get -y update
RUN apt-get --yes install libav-tools
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app
RUN npm install
COPY . /usr/src/app
RUN npm run build
ENV NODE_ENV production
EXPOSE 8000
CMD ["npm", "run", "start:prod"]

I would kindly ask for your help.我很乐意寻求您的帮助。 Thank you very much!非常感谢你!

This happened to me on windows.这发生在我身上。 Any of these commands will work这些命令中的任何一个都可以使用

On Windows CMD (not switching to bash)在 Windows CMD 上(不切换到 bash)

docker exec -it <container-id> /bin/sh

On Windows CMD (after switching to bash)在 Windows CMD 上(切换到 bash 后)

docker exec -it <container-id> //bin//sh

or要么

winpty docker exec -it <container-id> //bin//sh

On Git Bash在 Git Bash 上

winpty docker exec -it <container-id> //bin//sh

NB: You might need to run use /bin/bash or /bin/sh , depending on the shell in your container.注意:您可能需要运行 use /bin/bash/bin/sh ,具体取决于容器中的 shell。

The reason is documented in the ReleaseNotes file of Git and it is well explained here - Bash in Git for Windows: Weirdness...原因记录在 Git 的 ReleaseNotes 文件中,这里有很好的解释 - Bash in Git for Windows: Weirdness...

"The cause has to do with trying to ensure that posix paths end up being passed to the git utilities properly. For this reason, Git for Windows includes a modified MSYS layer that affects command arguments." “原因与试图确保 posix 路径最终正确传递给 git 实用程序有关。因此,Windows 版 Git 包括一个影响命令参数的修改后的 MSYS 层。”

I had this due to a simple ordering mistake on my end.由于我的一个简单的订购错误,我有这个。 I called我打了电话

[WRONG] docker run <image> <arguments> <command>

When I should have used当我应该使用

docker run <arguments> <image> <command>

Same resolution on similar question: https://stackoverflow.com/a/50762266/6278类似问题的相同解决方案: https : //stackoverflow.com/a/50762266/6278

Get rid of your quotes around your command.去掉你的命令周围的引号。 When you quote it, docker tries to run the full string "lsb_release -a" as a command, which doesn't exist.当您引用它时, "lsb_release -a"尝试将完整的字符串"lsb_release -a"作为命令运行,而该命令并不存在。 Instead, you want to run the command lsb_release with an argument -a , and no quotes.相反,您希望使用参数-a运行命令lsb_release并且不带引号。

sudo docker exec -it c44f29d30753 lsb_release -a

Note, everything after the container name is the command and arguments to run inside the container, docker will not process any of that as options to the docker command.请注意,容器名称之后的所有内容都是在容器内运行的命令和参数,docker 不会将其中的任何内容作为 docker 命令的选项进行处理。

If @papigee does solution doesn't work, maybe you don't have the permissions.如果@papigee确实解决方案不起作用,则可能是您没有权限。

I tried @papigee solution but does't work without sudo.我尝试了@papigee解决方案,但没有 sudo 就无法工作。

I did :我做了:

sudo docker exec -it <container id or name> /bin/sh
docker exec -it <containerId> sh

I solved this with this commands:我用这个命令解决了这个问题:

1- Run the container 1-运行容器

# docker run -d <image-name>

2- List containers 2- 列出容器

   # docker ps -a

3- Use the container ID 3- 使用容器 ID

# docker exec -it <container-id> /bin/sh

@papigee should work on Windows 10 just fine. @papigee 应该可以在 Windows 10 上正常工作。 I'm using the integrated VSCode terminal with git bash and this always works for me.我正在使用带有 git bash 的集成 VSCode 终端,这对我来说总是有效。

winpty docker exec -it <container-id> //bin//sh

I was running into this issue and it turned out that I needed to do this:我遇到了这个问题,结果我需要这样做:

docker run ${image_name} bash -c "${command}"

Hope that helps someone who finds this error.希望对发现此错误的人有所帮助。

What I did to solve was simply:我解决的问题很简单:

  1. Run docker ps -a运行 docker ps -a
  2. Check for the command of the container (mine started with /bin/sh)检查容器的命令(我的以 /bin/sh 开头)
  3. Run docker-compose exec < name_of_service > /bin/sh (if that is what started your command运行 docker-compose exec < name_of_service > /bin/sh (如果这是启动命令的原因

This is for solving when using docker compose这是在使用docker compose时解决的

You can use another shell to execute the same command:您可以使用另一个 shell 来执行相同的命令:

Error I get when i execute:执行时出现错误:

[jenkins@localhost jenkins_data]$ docker exec -it mysqldb \bin\bash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"binsh\": executable file not found in $PATH": unknown

Solution: When I execute it with below command, using bash shell it works:解决方案:当我使用以下命令执行它时,使用 bash shell 它可以工作:

[jenkins@localhost jenkins_data]$ docker exec -it mysqldb bash
root@<container-ID>:/#

This has happened to me.这发生在我身上。 My issue was caused when I didn't mount Docker file system correctly, so I configured the Disk Image Location and re-bind File sharing mount, and this now worked correctly.我的问题是由于我没有正确挂载 Docker 文件系统引起的,所以我配置了磁盘映像位置并重新绑定文件共享挂载,现在可以正常工作了。 For reference, I use Docker Desktop in Windows.作为参考,我在 Windows 中使用 Docker 桌面。

在我的情况下,我保存了 docker 图像,而不是在另一台机器上加载它,我导入了它,这是非常不同的,并导致我出现与此类似的错误。

这对我有用

docker exec -it <container ID> sh

you have to run like below:你必须像下面这样运行:

docker exec sh -c 'echo "$ENV_NAME"' docker exec sh -c 'echo "$ENV_NAME"'

I had windows line endings in a shell script.我在 shell 脚本中有 Windows 行结尾。 change to LF dos2unix更改为 LF dos2unix

docker exec -it test_db /bin/sh 或 docker exec -it test_db sh 对我有用,而 docker exec -it test_db bash 对我不起作用

对于高山码头图像

docker exec -it <container-id> sh
docker exec -it /bin/bash -c "ls /"

暂无
暂无

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

相关问题 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 运行时创建失败:runc 创建失败:无法启动容器进程:exec:“split_csv.py”:在 $PATH 中找不到可执行文件:未知 - OCI runtime create failed: runc create failed: unable to start container process: exec: "split_csv.py": 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: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” 如何解决 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”: Docker:OCI运行时创建失败:在$ PATH中找不到可执行文件 - Docker : OCI runtime create failed: executable file not found in $PATH docker-compose exec失败:在$ PATH中找不到可执行文件 - docker-compose exec failed: executable file not found in $PATH docker-exec 失败:“cd”:$PATH 中找不到可执行文件 - docker-exec failed: "cd": executable file not found in $PATH exec: \\“mysql\\”: 在 $PATH 中找不到可执行文件&quot;: 未知 - exec: \“mysql\”: executable file not found in $PATH": unknown
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM