0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Raspberry Pi4(CM4)に最新版のDockerをインストールする

Last updated at Posted at 2026-01-11

1. はじめに

これは自分で行った作業の備忘録であって、他の人の投稿やAIの回答と類似していたり同じであったりするかもしれない。

2. 準備

Server用OSインストール直後であれば、dockerはインストールされていないはず。
あらかじめインストールされているdockerのアプリのバージョン確認

sudo apt search docker | grep -e "docker.io" -e "docker-compose"

今のOSとアーキテクチャを調べる

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.3 LTS
Release:        24.04
Codename:       noble
$ uname -m
aarch64

Docker公式からインストールするための準備

sudo apt update
sudo apt install -y ca-certificates curl gnupg

Docker公式 GPGキー登録

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg  | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=arm64 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 > /dev/null

3. インストール

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

4. バージョン確認

コマンドは以下

docker version
docker compose version
$ docker version
Client: Docker Engine - Community
 Version:           29.1.3
 API version:       1.52
 Go version:        go1.25.5
 Git commit:        f52814d
 Built:             Fri Dec 12 14:50:13 2025
 OS/Arch:           linux/arm64
 Context:           default
permission denied while trying to connect to the docker API at unix:///var/run/docker.sock
$ docker compose version
Docker Compose version v5.0.1

5. まとめ

調査およびインストール作業の過程において、Docker Compose には v1(旧方式)と v2(現行方式)の 2系統のバージョンが存在することが判明した。ラズパイに限らず自動インストールを使用すると、v1のDocker Composeがインストールされることがある。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?