[英]executable file not found in $PATH: unknown
Trying to figure out why my dockerfile:试图弄清楚为什么我的 dockerfile:
FROM mcr.microsoft.com/powershell:ubuntu-focal
RUN apt-get -qq -y update && \
apt-get -qq -y upgrade && \
apt-get -qq -y install curl ca-certificates python3-pip exiftool mkvtoolnix
RUN pip3 install gallery-dl yt-dlp
WORKDIR /mydir
COPY gallery-dl.ps1 .
ENTRYPOINT ["gallery-dl.ps1"]
throws the following error when run:运行时抛出以下错误:
> docker build --file gallery-dl.dockerfile --tag psa .
> docker run -it --rm --name psatest psa
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "gallery-dl.ps1": executable file not found in $PATH: unknown.
I've tried seemingly everything: using CMD instead of ENTRYPOINT, modifying the COPY dest to ./gallery-dl.ps1
, changing the order of commands.我似乎尝试了所有方法:使用 CMD 而不是 ENTRYPOINT,将 COPY dest 修改为
./gallery-dl.ps1
,更改命令的顺序。 I've prepended #!/usr/bin/pwsh -File
to the ps1 script (as instructed in a different question of mine).我已经将
#!/usr/bin/pwsh -File
到 ps1 脚本中(按照我的另一个问题中的指示)。 When I attach into the container and ls it shows all of my mounts and gallery-dl.ps
itself where it should be and where I'm supposedly calling it:当我附加到容器中并 ls 它显示我所有的坐骑和
gallery-dl.ps
本身应该在哪里以及我应该在哪里调用它:
PS /mydir> ls
conf gallery-dl.ps1 output
The only thing that works is removing WORKDIR but I actually need that, I can't just run everything in root.唯一可行的是删除 WORKDIR 但我实际上需要它,我不能只在 root 中运行所有内容。
Two things: Make sure the file is marked as executable.两件事:确保文件被标记为可执行文件。 And since
/mydir
isn't in your path, you need to tell Docker to look for the script in the current directory by adding ./
in front of the name.由于
/mydir
不在您的路径中,您需要通过在名称前添加./
来告诉 Docker 在当前目录中查找脚本。
FROM mcr.microsoft.com/powershell:ubuntu-focal
RUN apt-get -qq -y update && \
apt-get -qq -y upgrade && \
apt-get -qq -y install curl ca-certificates python3-pip exiftool mkvtoolnix
RUN pip3 install gallery-dl yt-dlp
WORKDIR /mydir
COPY gallery-dl.ps1 .
RUN chmod +x gallery-dl.ps1
ENTRYPOINT ["./gallery-dl.ps1"]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.