0
0

More than 3 years have passed since last update.

【Raspberry Pi 4】コンテナ環境構築 ~podmanを添えて~

Last updated at Posted at 2021-02-13

自宅サーバ(Raspberry Pi 4 Model B)をコンテナ化して綺麗にしよう
ということで、コンテナを導入します。

OSはDebianベースの"Raspberry Pi OS"となります。

1 podmanのインストール(Debian編)

単純に"apt-get install podman"で済めばよいのですが、そうは問屋が卸しません。
何はともあれ公式ページを開きDebianでのインストール方法を参考にします。
URL: Podman Installation Instructions

podmanをインストールするには"libseccomp2"パッケージが必要なようです。
"libseccomp2"を入手するために、aptのソースリストに"buster-backports"の追加を行います。

公式手順ではechoによる書き込みを行っていますが、私はviでファイル作成と記述を行いました。

Step.1
#Step.1-1
vi /etc/sysctl.d/00-local-userns.conf
#一文を追加 → kernel.unprivileged_userns_clone=1

#Step.1-2
systemctl restart procps

#Step.1-3
vi /etc/apt/sources.list 
#一文を追加 → deb http://deb.debian.org/debian buster-backports main

#Step.1-4
vi /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
#一文を追加 → deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /

#Step.1-5
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/Release.key | sudo apt-key add -

これでapt-getの準備は整ったので、"libseccomp2"パッケージをインストールします。

Step.2
#Step.2-1
sudo apt-get update

#Step.2-2
sudo apt-get -y -t buster-backports install libseccomp2

#Step.2-3
sudo apt-get -y install podman

#Step.2-4 ※再起動が発生しますのでご注意
systemctl --user restart dbus

インストールされたことが確認できたら完了です。

Step.3
#Step.3-1
apt list --installed podman

コンテナの作成については、用途別になるので記事を分けます。
予定しているのはWordpress(Webサーバ)とNextcloud(ファイルサーバ)です。

お疲れさまでした。

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