Podman: Difference between revisions

From Alpine Linux
(Created page with "== Installation == The Podman package is in the 'Testing' repository. See Alpine_Linux_package_management how to add a repository. apk add podman To run Podman you'll...")
 
m (Formatting and added category)
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Installation ==
== Installation ==


The Podman package is in the 'Testing' repository. See [[Alpine_Linux_package_management]] how to add a repository.
Podman can be installed via {{Pkg|podman}} package in the community repository.


apk add podman
{{Cmd|# 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 <code>cgroups</code> service, consider enabling [[OpenRC#cgroups v2|cgroups v2]].


rc-update add cgroups
{{Cmd|# rc-update add cgroups}}
rc-service cgroups start
{{Cmd|# rc-service cgroups start}}


Run an example container to verify everything works
You might need to restart your machine for this to work properly.


  podman run -d --rm --name nginx -p 80:80 docker.io/nginx:latest
If you are running on top of [[Btrfs]], consider setting storage driver to <code>btrfs</code>:
curl localhost
 
podman stop nginx
{{Cmd|$ cat /etc/containers/storage.conf | grep 'driver ='}}
 
  driver = "btrfs"
 
For rootless support (replace <USER> with your username):
 
{{Cmd|# modprobe tun
&#35; echo tun >>/etc/modules
&#35; echo <USER>:100000:65536 >/etc/subuid
&#35; echo <USER>:100000:65536 >/etc/subgid}}
 
Run an example container to verify everything works:
 
{{Cmd|$ podman run --rm hello-world}}
 
[[Category:Virtualization]]

Revision as of 15:32, 17 April 2023

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

$ cat /etc/containers/storage.conf

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