Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker alpine /bin/sh script.sh not found

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.

like image 637
Thiago G. Alves Avatar asked Nov 13 '17 18:11

Thiago G. Alves


1 Answers

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).

like image 106
Charles Duffy Avatar answered Sep 19 '22 14:09

Charles Duffy