Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.
Meanwhile, Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation in association with Broadcom. The Raspberry Pi project originally leaned towards the promotion of teaching basic computer science in schools and in developing countries.
Prerequisites
This tutorial will require you to prepare a Raspberry Pi with Raspberry Pi OS installed. We would recommend you to use Raspberry Pi 4. You can get it from Cytron Marketplace.
Step 1 : Update Raspberry Pi Operating System
Before we start any installation, it is recommend to update the operating system so that the operating system get the latest list of package source.
apt-get update && apt-get upgrade -y
Step 2 : Install Docker Engine
Install the latest version of Docker Engine.
curl -sSL https://get.docker.com | sh
Test Docker Compose via this command :
docker version
Step 3 : Enable Docker Auto Start On Reboot
systemctl enable docker
Step 4 : Start Docker Engine
service docker start
Step 5 : Install Docker Compose
Docker-Compose usually gets installed using pip3. For that, we need to have python3 and pip3 installed. If you don’t have it installed, you can run the following commands :
sudo apt-get install libffi-dev libssl-dev
sudo apt install python3-dev
sudo apt-get install -y python3 python3-pip
Once python3 and pip3 are installed, we can install Docker-Compose using the following command:
sudo pip3 install docker-compose
Test Docker Compose via this command :
docker-compose --version