简体   繁体   English

入口点:在 $PATH 中找不到可执行文件:未知

[英]Entrypoint: Executable file not found in $PATH: unknown

I'm trying to run a Dockerfile but apparently my entrypoint.sh does not work.我正在尝试运行 Dockerfile 但显然我的 entrypoint.sh 不起作用。

ERROR: for hermes Cannot start service hermes: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "entrypoint.sh": executable file not found in $PATH: unknown错误:对于爱马仕无法启动服务爱马仕:未能创建垫片任务:OCI运行时创建失败:runc创建失败:无法启动容器进程:exec:“entrypoint.sh”:在$ PATH中找不到可执行文件:未知

Here my dockerfile:这是我的 dockerfile:

FROM debian:buster

#SHELL ["/bin/bash", "-c"]

# Ruby configuration
ARG ruby_version=3.1.1

# Install system dependencies
RUN apt-get update && apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common \
    gnupg \
    gpg-agent \
    ruby-full \
    ruby-dev \
    procps \
    libpq-dev \
    git

# Create the workspace into the container
RUN mkdir -p /hermes-app && \
    chmod -R 777 /hermes-app
COPY srcs/ /hermes-app/
COPY scripts/rvm.sh /hermes-app/rvm.sh
COPY scripts/gems.sh /hermes-app/gems.sh
RUN chmod +x /hermes-app/rvm.sh
RUN chmod +x /hermes-app/gems.sh

# Time: 454s (9mtin) for the installation of RVM
RUN bash /hermes-app/gems.sh
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import -
RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
RUN \curl -sSL https://get.rvm.io | bash -s stable --ruby
RUN bash /hermes-app/rvm.sh $ruby_version
RUN chmod -R 777 /usr/local/rvm/gems/ruby-${ruby_version}

# Create user
WORKDIR /hermes-app
RUN useradd -m -s /bin/bash moderator
USER moderator
RUN echo "source /usr/local/rvm/scripts/rvm" >> ~/.bashrc

ENTRYPOINT [ "entrypoint.sh" ]

My path in local is like:我在本地的路径如下:

Me:hermes-app$ ls
Dockerfile    db            entrypoint.sh scripts       srcs

Thanks in advance:(提前致谢:(

You need to add entrypoint.sh to your container and give it correct executable permissions to run it:您需要将entrypoint.sh添加到您的容器并为其提供正确的可执行权限以运行它:

ADD entrypoint.sh /hermes-app/entrypoint.sh
RUN chmod +x /hermes-app/entrypoint.sh
ENTRYPOINT [ "/hermes-app/entrypoint.sh" ]

You would also need to copy the entrypoint.sh script into the container by adding this line:您还需要通过添加以下行将entrypoint.sh脚本复制到容器中:

COPY entrypoint.sh /hermes-app/entrypoint.sh

暂无
暂无

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

相关问题 使用 hyperledger fabric 调用链代码:在 $PATH\": unknown" 中找不到可执行文件 - Invoking chaincode with hyperledger fabric: 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. 启动容器进程导致“exec:\”bash\“:在 $PATH 中找不到可执行文件”:未知 - starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown 无法找到可执行文件:“bash”。 请验证文件路径是否存在或该文件可以在 PATH 指定的目录中找到 - Unable to locate executable file: 'bash'. Please verify either the file path exists or the file can be found within a directory specified by the PATH 使我的$ PATH上的可执行文件报告“找不到命令” - make reports “command not found” for an executable on my $PATH 使用Dockerfile ENTRYPOINT找不到exec - exec not found using Dockerfile ENTRYPOINT 配置bash $ PATH变量以查找UNIX可执行文件 - Configuring bash $PATH variable to find UNIX executable file 在 entrypoint.sh 中运行 docker 命令时找不到 docker - docker is not found when running a docker command in entrypoint.sh 可执行文件不从PATH变量中搜索 - Executable not searching from PATH variable Linux中python的可执行路径错误 - Wrong executable path for python in linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM