[Raspberry Pi 4] Install Docker on Ubuntu Server 21.04

Docker

This is a memo. Since Ubuntu Hirsute 21.04 is already installed on the Raspberry Pi, installing Docker only requires following the procedure on the official site.

Test Environment

Raspberry Pi 4, 4GB memory

Ubuntu Server 21.04

Install Docker

# 旧バージョン等のクリーンアップ
$ sudo apt-get remove docker docker-engine docker.io containerd runc
# Set up the repository
$ sudo apt-get update

$ sudo apt-get install -y
apt-transport-https
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

set up the stable repository for arm64

$ echo
“deb [arch=arm64 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

# Install Docker Engine
$ sudo apt-get update
$ sudo apt-get install -y docker-ce docker-ce-cli containerd.io

# Docker-composeもインストールする
$ sudo apt install -y python3-pip
$ sudo pip3 install docker-compose

# バージョンの確認
$ docker --version
Docker version 20.10.7, build f0df350
$ docker-compose --version
docker-compose version 1.29.2, build unknown

Try Running the Hello World Image

# Verify that Docker Engine is installed correctly by running the hello-world image.
$ sudo docker run hello-world

sudo なしで dockerコマンドを扱えるようにしておく。

$ sudo usermod -a -G docker ubuntu

Me
Me

This is just an operation log.