找不到docker alpine / bin / sh script.sh [英] docker alpine /bin/sh script.sh not found
问题描述
我正在尝试构建以 openjdk:8-alpine 为基础的docker映像。
问题是当我尝试执行脚本时.sh ,向我返回以下消息:
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
script.sh 位于 bin / 正确的文件夹,这就是为什么我不知道出什么问题的原因。
The script.sh is in the bin/ folder correctly, that's why I don't know what's the problem.
任何人都有想法吗?
谢谢。
推荐答案
请确保脚本上的shebang指向实际存在的解释器。因此,如果正在调用的脚本使用:
Make sure the shebang on the script points to an interpreter that actually exists. Thus, if the script being invoked uses:
#!/bin/bash
...然后需要实际安装 / bin / bash
。 (或者,您可以考虑尝试将该脚本移植到POSIX sh上,然后将其shebang修改为 / bin / sh
)。
...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
).
这篇关于找不到docker alpine / bin / sh script.sh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!