Podman: Difference between revisions

From Alpine Linux
(Brought back necessary steps to run podman)
(Update for podman on 3.15)
Line 1: Line 1:
== Installation ==
== Installation ==


The Podman package is from the alpine version 3.14 on in the 'community' repository.
Podman can be installed via `podman` package in the community repository.


   apk add podman
   # apk add podman


To run Podman you'll need to enable the cgroups service, see [[Alpine_Linux_Init_System]].
To run podman you'll need to enable the cgroups service, consider enabling [[OpenRC#cgroups v2|cgroups v2]].
  rc-update add cgroups
  rc-service cgroups start


For rootless support:
  # rc-update add cgroups
  # rc-service cgroups start


  apk add fuse-overlayfs shadow slirp4netns
You might need to restart your machine for this to work properly.
  modprobe tun
  usermod --add-subuids 100000-165535 <user>
  usermod --add-subgids 100000-165535 <user>
  podman system migrate


Run an example container to verify everything works
If you are running on top of btrfs, consider setting driver to btrfs:


   podman run --rm hello-world
   +  $ cat /etc/containers/storage.conf | grep 'driver ='
  driver = "btrfs"
 
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

Revision as of 14:59, 16 February 2022

Installation

Podman can be installed via `podman` package in the community repository.

 # apk add podman

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 driver to btrfs:

 +   $ cat /etc/containers/storage.conf | grep 'driver ='
 driver = "btrfs"

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