Podman: Difference between revisions

From Alpine Linux
(split into two sections)
m (this is not markdown)
Line 5: Line 5:
{{Cmd|# apk add podman}}
{{Cmd|# apk add podman}}


## Running as root
=== Running as root ===


To run podman you'll need to enable the <code>cgroups</code> service, consider enabling [[OpenRC#cgroups v2|cgroups v2]].
To run podman you'll need to enable the <code>cgroups</code> service, consider enabling [[OpenRC#cgroups v2|cgroups v2]].
Line 20: Line 20:
  driver = "btrfs"
  driver = "btrfs"


### Running in rootless mode
=== Running in rootless mode ===


For rootless support (replace <USER> with your username):
For rootless support (replace <USER> with your username):

Revision as of 18:55, 30 April 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