This post will guide you how to install Bash Shell in your Alpine Linux Docker Virtual Machine. How do I Use Bash Shell in Alpine Linux.
Insatlling Bash Shell in Alpine Linux
When you run a alpine Linux through docker in your Linux system, and the bash shell is not installed by default. So if you want to use bash shell in your Alpine Linux Virtual machine, you need to installed it in the Alpine Linux. just run the following commands:
$ apk update $ apk upgrade $ apk add bash
outputs:
/ # apk update fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz v3.10.2-46-gbb3e7ac09b [http://dl-cdn.alpinelinux.org/alpine/v3.10/main] v3.10.2-42-g95d37f7648 [http://dl-cdn.alpinelinux.org/alpine/v3.10/community] OK: 10336 distinct packages available / # apk upgrade (1/2) Upgrading libcrypto1.1 (1.1.1c-r0 -> 1.1.1d-r0) (2/2) Upgrading libssl1.1 (1.1.1c-r0 -> 1.1.1d-r0) OK: 6 MiB in 14 packages / # apk add bash (1/5) Installing ncurses-terminfo-base (6.1_p20190518-r0) (2/5) Installing ncurses-terminfo (6.1_p20190518-r0) (3/5) Installing ncurses-libs (6.1_p20190518-r0) (4/5) Installing readline (8.0.0-r0) (5/5) Installing bash (5.0.0-r0) Executing bash-5.0.0-r0.post-install Executing busybox-1.30.1-r2.trigger OK: 14 MiB in 19 packages
Then you can type bash command in your current Alpine Linux to enter into bash shell program, type:
$ bash
outputs:
/ # bash bash-5.0# ls bin dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var bash-5.0#