[英]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.