インストール: docker

ネットで、公式が間違ってるという記事がありましたが、公式に以下の記述があります

Raspbian users cannot use this method!
For Raspbian, installing using the repository is not yet supported. You must instead use the convenience script.

なのでこちらを見ながら進めます

1
2
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh ./get-docker.sh

インストール: docker-compose

1
2
3
4
5
6
7
8
9
// apt-lineの確認
$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

// 必要な物をインストール
$ sudo apt install -y python-dev python-pip libffi-dev libssl-dev

// pipでdocker-composeのインストール
$ pip install docker-compose

そのままだとPATHが通っていませんでした

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$ docker-compose -v
-bash: docker-compose: command not found

// どこにあるか確認
$ sudo find / -name docker-compose
/home/pi/.local/bin/docker-compose

// そのまま実行しても別のエラー
$ python .local/bin/docker-compose -v
Traceback (most recent call last):
File ".local/bin/docker-compose", line 6, in <module>
from compose.cli.main import main
File "/home/pi/.local/lib/python2.7/site-packages/compose/cli/main.py", line 18, in <module>
import docker.errors
File "/home/pi/.local/lib/python2.7/site-packages/docker/__init__.py", line 2, in <module>
from .api import APIClient
File "/home/pi/.local/lib/python2.7/site-packages/docker/api/__init__.py", line 2, in <module>
from .client import APIClient
File "/home/pi/.local/lib/python2.7/site-packages/docker/api/client.py", line 10, in <module>
from .build import BuildApiMixin
File "/home/pi/.local/lib/python2.7/site-packages/docker/api/build.py", line 6, in <module>
from .. import auth
File "/home/pi/.local/lib/python2.7/site-packages/docker/auth.py", line 9, in <module>
from .utils import config
File "/home/pi/.local/lib/python2.7/site-packages/docker/utils/__init__.py", line 3, in <module>
from .decorators import check_resource, minimum_version, update_headers
File "/home/pi/.local/lib/python2.7/site-packages/docker/utils/decorators.py", line 4, in <module>
from . import utils
File "/home/pi/.local/lib/python2.7/site-packages/docker/utils/utils.py", line 13, in <module>
from .. import tls
File "/home/pi/.local/lib/python2.7/site-packages/docker/tls.py", line 5, in <module>
from .transport import SSLHTTPAdapter
File "/home/pi/.local/lib/python2.7/site-packages/docker/transport/__init__.py", line 3, in <module>
from .ssladapter import SSLHTTPAdapter
File "/home/pi/.local/lib/python2.7/site-packages/docker/transport/ssladapter.py", line 23, in <module>
from backports.ssl_match_hostname import match_hostname
ImportError: No module named ssl_match_hostname

PATHを通せば解決しました

1
2
3
4
5
6
7
// .bash_profileなどに以下を書いてPATHを通す
$ cat .bash_profile | grep PATH
PATH="$PATH":/home/pi/.local/bin/
PATH="$PATH":/home/pi/.local/lib/python2.7/site-packages

$ docker-compose -v
docker-compose version 1.25.3, build unknown