[fix] Docker: Alpine Linux - /bin/sh: bash: not found


Docker Alpine Linux bash not found

If you have installed Alpine Linux image using Docker and you get, /bin/sh: bash: not found, the reason is that you do not get bash shell installed on with this image, you only get sh shell.

You should make use of sh instead to keep the footprint, if you still want to install bash, use command RUN apk add --no-cache bash

You can also, run the command apk add bash after you run alpine Linux,

Example:
# apk add bash
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/aarch64/APKINDEX.tar.gz
(1/4) Installing ncurses-terminfo-base (6.3_p20211120-r0)
(2/4) Installing ncurses-libs (6.3_p20211120-r0)
(3/4) Installing readline (8.1.1-r0)
(4/4) Installing bash (5.1.16-r0)
Executing bash-5.1.16-r0.post-install
Executing busybox-1.34.1-r5.trigger
OK: 8 MiB in 18 packages
Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.