How to install package [ bash, tree, curl, wget ] in alpine docker container?

Today, we shall explore the steps to install common tools/packages in an alpine container (from within the container, at the run time).

In general, to install any package at the run time, you would have to:

  • Connect to the container
  • Run the apk add command

Example #1 Docker alpine install bash

The most popular shell, Bash! That is not a built-in for Alpine! Let’s install it.

Connect to your docker-alpine container and run the package installation command as shown here:

apk add --no-cache bash
alpine install bash

Example #2 How to install tree command in alpine docker container

Next, let’s install the tree command

apk add --no-cache tree
alpine installed package tree

Example #3 Docker alpine install curl and wget

Next, let’s install wget and curl together.

apk add --no-cache curl wget

I hope that helps. If you have more queries, you can fill in the form – Ask a question