Overview
Ubuntu 22.04 に Podman をインストールします。Podman は CentOS では 8 以降から標準のコンテナ実行環境になっていますが、Ubuntu でも問題なく利用可能です。
インストール
Podman をインストールします。
sudo DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install podman
IPv4 の変更と IPv6 対応
IPv4 の変更と IPv6 に対応させます。反映は systemctl でそれらしいサービスを再起動してみたのですが反映されず、reboot しています。
sudo tee /etc/cni/net.d/87-podman-bridge.conflist <<"EOF"
{
"cniVersion": "0.4.0",
"name": "podman",
"plugins": [
{
"type": "bridge",
"bridge": "cni-podman0",
"isGateway": true,
"ipMasq": true,
"hairpinMode": true,
"ipam": {
"type": "host-local",
"routes": [{ "dst": "0.0.0.0/0" }],
"ranges": [
[
{
"subnet": "172.27.0.0/16",
"gateway": "172.27.0.1"
}
],
[
{
"subnet": "fd00:0000:0000:000b:0000:0000:0000:0000/64",
"gateway": "fd00:0000:0000:000b:0000:0000:0000:0001"
}
]
]
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
},
{
"type": "firewall"
},
{
"type": "tuning"
}
]
}
EOF
インストール状態の確認
インストール状態を確認します。
sudo podman info
出力結果は以下の通りです。
host:
arch: arm64
buildahVersion: 1.23.1
cgroupControllers:
- cpuset
- cpu
- io
- memory
- hugetlb
- pids
- rdma
- misc
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: 'conmon: /usr/bin/conmon'
path: /usr/bin/conmon
version: 'conmon version 2.0.25, commit: unknown'
cpus: 2
distribution:
codename: jammy
distribution: ubuntu
version: "22.04"
eventLogger: journald
hostname: ubuntu
idMappings:
gidmap: null
uidmap: null
kernel: 5.15.0-76-generic
linkmode: dynamic
logDriver: journald
memFree: 1806524416
memTotal: 8314695680
ociRuntime:
name: runc
package: 'runc: /usr/sbin/runc'
path: /usr/sbin/runc
version: |-
runc version 1.1.4-0ubuntu1~22.04.3
spec: 1.0.2-dev
go: go1.18.1
libseccomp: 2.5.3
os: linux
remoteSocket:
exists: true
path: /run/podman/podman.sock
security:
apparmorEnabled: true
capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
rootless: false
seccompEnabled: true
seccompProfilePath: /usr/share/containers/seccomp.json
selinuxEnabled: false
serviceIsRemote: false
slirp4netns:
executable: /usr/bin/slirp4netns
package: 'slirp4netns: /usr/bin/slirp4netns'
version: |-
slirp4netns version 1.0.1
commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
libslirp: 4.6.1
swapFree: 4100976640
swapTotal: 4100976640
uptime: 50h 17m 27.02s (Approximately 2.08 days)
plugins:
log:
- k8s-file
- none
- journald
network:
- bridge
- macvlan
volume:
- local
registries: {}
store:
configFile: /etc/containers/storage.conf
containerStore:
number: 16
paused: 0
running: 16
stopped: 0
graphDriverName: overlay
graphOptions: {}
graphRoot: /var/lib/containers/storage
graphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
imageStore:
number: 14
runRoot: /run/containers/storage
volumePath: /var/lib/containers/storage/volumes
version:
APIVersion: 3.4.4
Built: 0
BuiltTime: Thu Jan 1 09:00:00 1970
GitCommit: ""
GoVersion: go1.18.1
OsArch: linux/arm64
Version: 3.4.4
Ubuntu 22.04 Podman コンテナ実行環境構築