Often, docker images will be published in GitHub using a file called docker-compose.yml or compose.yml. With Docker Compose, we can create yaml (.yml) configuration files that define everything we’d like running within a container, including options like:

Why? Remember command line parameters can be difficult!

For example:

can be difficult to recall, and typos can cause things to break. Creating a file with all configuration options saved in an easier-to-manage format is better. Once we have everything set up correctly, we can use this file to start/run containers with complex configurations easily.

Install docker-compose

apt install docker-compose

If docker-compose isn’t installable via the *apt* package manager, we can install it manually like this.

sudo curl -L "<https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$>(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

You can verify that docker-compose has been installed with this command:

docker-compose --version