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
3. Starting a Shell in an Alpine Container. Alpine is the most lightweight Linux distribution. Due to its small size, many people are using Alpine as their base image.
Note: By default Alpine Linux uses the ash shell, but many users may prefer bash, zsh, fish or another shell.
Alpine docker image doesn't have bash installed by default. You will need to add the following commands to get bash
:
RUN apk update && apk add bash
If you're using Alpine 3.3+
then you can just do:
RUN apk add --no-cache bash
To keep the docker image size small. (Thanks to comment from @sprkysnrky)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With