Table of Content

Posts

docker alpine /bin/sh script.sh not found

Problem

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.

Solution and Answer

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

Post a Comment