docker alpine /bin/sh script.sh not found

瘦欲@ 提交于 2020-02-23 08:45:06

问题


I'm trying to build a docker image that has the openjdk:8-alpine as base.
The problem is when I try to execute a script.sh, returning me the following message:

/bin/sh: bin/script.sh: not found

The script.sh is in the bin/ folder correctly, that's why I don't know what's the problem.

Anyone have any idea?

Thank you.


回答1:


Make sure the shebang on the script points to an interpreter that actually exists. Thus, if the script being invoked uses:

#!/bin/bash

...then /bin/bash needs to actually be installed. (Alternately, you might consider trying to port the script to work with POSIX sh, and modifying its shebang to /bin/sh).



来源:https://stackoverflow.com/questions/47270976/docker-alpine-bin-sh-script-sh-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!