Podman: Difference between revisions
(Added the missing steps to get rootless working) |
WhyNotHugo (talk | contribs) (docker compose) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
== Installation == | == Installation == | ||
Podman can be installed via {{Pkg|podman}} package in the community repository. | |||
{{Cmd|# apk add podman}} | |||
=== Running as root === | |||
To run podman you'll need to enable the <code>cgroups</code> service, consider enabling [[OpenRC#cgroups v2|cgroups v2]]. | |||
{{Cmd|# rc-update add cgroups}} | |||
{{Cmd|# rc-service cgroups start}} | |||
You might need to restart your machine for this to work properly. | |||
If you are running on top of [[Btrfs]], consider setting storage driver to <code>btrfs</code>: | |||
{{Cmd|$ cat /etc/containers/storage.conf | grep 'driver ='}} | |||
driver = "btrfs" | |||
=== Running in rootless mode === | |||
For rootless support (replace <USER> with your username): | |||
{{Cmd|# modprobe tun | |||
# echo tun >>/etc/modules | |||
# echo <USER>:100000:65536 >/etc/subuid | |||
# echo <USER>:100000:65536 >/etc/subgid}} | |||
Run an example container to verify everything works: | |||
{{Cmd|$ podman run --rm hello-world}} | |||
=== Docker compose === | |||
Podman provides a drop-in replacement for docker compose. The {{Pkg|podman-compose}} package provides this. | |||
Each time that docker compose is used, a warning will remind that this is using podman under the hood. This warning can be squelched permanently by running: | |||
touch /etc/containers/nodocker | |||
[[Category:Virtualization]] |
Revision as of 16:55, 1 May 2024
Installation
Podman can be installed via podman package in the community repository.
# apk add podman
Running as root
To run podman you'll need to enable the cgroups
service, consider enabling cgroups v2.
# rc-update add cgroups
# rc-service cgroups start
You might need to restart your machine for this to work properly.
If you are running on top of Btrfs, consider setting storage driver to btrfs
:
$ cat /etc/containers/storage.conf
driver = "btrfs"
Running in rootless mode
For rootless support (replace <USER> with your username):
# modprobe tun # echo tun >>/etc/modules # echo <USER>:100000:65536 >/etc/subuid # echo <USER>:100000:65536 >/etc/subgid
Run an example container to verify everything works:
$ podman run --rm hello-world
Docker compose
Podman provides a drop-in replacement for docker compose. The podman-compose package provides this.
Each time that docker compose is used, a warning will remind that this is using podman under the hood. This warning can be squelched permanently by running:
touch /etc/containers/nodocker