Day 3: Doccker on Raspberry Pi 5
The docker set up on Raspberry pi is simple, just follow the official instruction from docker, here is a simplified version.
Step 1: install software
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 2: Test
sudo docker run hello-world
Step 3: Allow run as pi
By default, only root user can run docker command, to allow pi run the docker command:
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world
Next: Day 4