Learn how to install Docker on a Raspberry Pi.
Here are the commands and a short description of what it does.
1. Update your Raspberry
sudo apt update
sudo apt dist-upgrade
2. Install required packages
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
3. Add Docker’s official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubu... | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
4. Setup repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
5. Install Docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
OR
curl -sSL https://get.docker.com | sh
6. Allow non-root users to run docker
sudo usermod -aG docker pi
7. Test Docker with “Hello World”
docker run -it hello-world
docker --version
8. Reboot the Linux box.
sudo reboot
This video also explains how to resolve the error shown below.
W: The repository 'https://apt.dockerproject.org/repo ubuntu-xenial Release' does not have a Release file.
#docker #raspberrypi