Docker Compose
Docker Compose simplifies the management of multi-container applications with Docker. This leaves more time to focus on the applications and not so much on your infrastructure.
Installation
To use Docker Compose, Docker and Docker Compose must first be installed. In principle, any server can be used, regardless of whether it is a server in the home network or a rented one in a data center.
- Arch
- Raspberry Pi
- Synology
- Ubuntu
- Windows
Docker Engine
sudo apt install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Docker Compose
sudo mkdir -p /usr/local/lib/docker/cli-plugins/
sudo curl -SL https://github.com/docker/compose/releases/download/v2.3.4/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
If there is a new release of Docker Compose, you have to change the respective line in the command.
Docker Installation
To install Docker on a Synology NAS, all you need to do is to get Docker from the package center.
Docker Compose
There are basically two ways to use Docker Compose:
- Connecting via SSH
- Installing and using Portainer
If necessary, you should also install the Git server from the package center, if you want to clone repositories.
Docker Engine
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
rm get-docker.sh
Docker Compose
sudo apt install -y python3-pip libffi-dev
sudo pip3 install docker-compose
Docker Compose may not work yet because it was installed in a different location than the system expected. In this case, a link still needs to be set.
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Docker Engine
For Windows (and also macOS), there is the Docker Desktop software, which you can download from Docker Hub .
Pacman
For Arch Linux the installation runs via Pacman.
sudo pacman -S docker docker-compose
sudo systemctl enable docker
info
Depending on whether you install Docker Compose version 1 or 2, the syntax changes. With version 1 it is still docker-compose
, with version 2 it is finally docker compose
. You always have to keep this in mind.
warning
If you have a device with an ARM CPU (e.g. Raspberry Pi), only the ARM compatible images will work. All Docker images that are not intended for ARM devices will not work.
On Docker Hub, you can filter operating systems and architectures to identify applications that are fully supported.