/ usr / src /
app可能不在您的路径中,因此您应该包括脚本的完整路径。您还需要确保entrypoint.sh是可执行的,docker将完全按照您的构建主机上的权限复制权限,因此根据您的情况,可能不需要此步骤。
FROM ruby:2.4-alpineWORKDIR /usr/src/appCOPY Gemfile /usr/src/app/GemfileCOPY Gemfile.lock /usr/src/app/Gemfile.lockRUN bundle config build.nokogiri --use-system-librariesRUN bundle install --without development testVOLUME /stateCOPY . /usr/src/app/RUN chmod 755 api-entrypoint.shENTRYPOINT ["/usr/src/app/api-entrypoint.sh"]CMD ["foreman", "start"]



