How to install docker-compose on a fresh Alpine Linux

Alpine Linux is a Linux distribution based on musl and BusyBox, primarily designed for power users who appreciate security, simplicity and resource efficiency.

1. Edit repository file
Open the /etc/apk/repositories with your text editor and uncomment the line for community. In my case, I will use vi.

vi /etc/apk/repositories

2. Update packages
To get the latest list of available packages, use the update command.

apk update

3. Upgrade installed packages (Optional)

apk upgrade

4. Install Docker
We need to install docker, add it in the startup, and start the docker service.

apk add docker
rc-update add docker boot
service docker start

5. Install docker-compose
docker-compose is not yet available in apk, so we will be using PIP to install it.

apk add py-pip
pip install docker-compose

Congratulations, you should now have docker-compose in your fresh Alpine Linux

Leave a Reply

Your email address will not be published. Required fields are marked *