Install Bash on Alpine Linux - Docker

The Alpine Linux Image is ~5MB in size, so it will not contain most of the non-essential packages. To have the size limited you will not get the bash shell either, if you try to run a bash script or command, you will get an error: sh: bash: not found

# bash
sh: bash: not found

Install bash on Alpine Linux using apk

Install Bash on Alpine Linux Command
# apk add bash

(1/1) Installing bash (5.1.16-r2)
Executing busybox-1.35.0-r17.trigger
OK: 58 MiB in 28 packages

Install bash on Dockerfile with Alpine Linux base Image

FROM alpine:latest
RUN apk add bash
CMD bash

Have Questions? Post them here!