I created a docker image from openjdk:8-jdk-alpine but when I try to execute simple commands I get the following errors:
RUN bash
/bin/sh: bash: not found
RUN ./gradlew build
env: can't execute 'bash': No such file or directory
I created a docker image from openjdk:8-jdk-alpine but when I try to execute simple commands I get the following errors:
RUN bash
/bin/sh: bash: not found
RUN ./gradlew build
env: can't execute 'bash': No such file or directory
worked for me.
Try using
RUN /bin/sh
instead of bash.Alpine docker image doesn't have bash installed by default. You will need to add following commands to get
bash
:If youre using
Alpine 3.3+
then you can just doto keep docker image size small. (Thanks to comment from @sprkysnrky)
To Install bash you can do:
If you do not want to add extra size to your image, you can use
ash
orsh
that ships with alpine.Reference: https://github.com/smebberson/docker-alpine/issues/43