找不到入口点文件 [英] entrypoint file not found

查看:60
本文介绍了找不到入口点文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用此命令的docker映像:

I have a docker image with this command:

FROM ruby:2.4-alpine
WORKDIR /usr/src/app

COPY Gemfile /usr/src/app/Gemfile
COPY Gemfile.lock /usr/src/app/Gemfile.lock

RUN bundle config build.nokogiri --use-system-libraries
RUN bundle install --without development test

VOLUME /state

COPY . /usr/src/app/

ENTRYPOINT ["api-entrypoint.sh"]
CMD ["foreman", "start"]

它可以正确构建,但是例如,当我尝试运行bash时,我得到了这个
container_linux.go:247 :正在启动引起的容器进程 exec:\ api-entrypoint.sh\:在$ PATH中找不到可执行文件
泊坞窗:来自守护程序的错误响应:oci运行时错误:container_linux.go:247:正在启动容器进程导致 exec:\ api-entrypoint.sh\:在$ PATH中找不到可执行文件。

it builds correctly but when I try to run bash, for example, I get this container_linux.go:247: starting container process caused "exec: \"api-entrypoint.sh\": executable file not found in $PATH" docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"api-entrypoint.sh\": executable file not found in $PATH".

I尝试复制入口点文件,并使用 CMD 授予其可执行权限...什么都不起作用

I tried copy the entrypoint file, give it executable permissions as well with CMD...nothing worked

推荐答案

/ usr / src / app可能不在您的路径中,因此您应该包括脚本的完整路径。您还需要确保entrypoint.sh是可执行文件,docker将完全按照您的构建主机上的权限复制权限,因此根据您的情况,可能无需执行此步骤。

/usr/src/app may not be in your path so you should include the full path to the script. You also need to ensure that your entrypoint.sh is executable, docker will copy the permissions exactly as they are on your build host, so this step may not be needed depending on your scenario.

FROM ruby:2.4-alpine
WORKDIR /usr/src/app

COPY Gemfile /usr/src/app/Gemfile
COPY Gemfile.lock /usr/src/app/Gemfile.lock

RUN bundle config build.nokogiri --use-system-libraries
RUN bundle install --without development test

VOLUME /state

COPY . /usr/src/app/
RUN chmod 755 api-entrypoint.sh

ENTRYPOINT ["/usr/src/app/api-entrypoint.sh"]
CMD ["foreman", "start"]

这篇关于找不到入口点文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆