Skip to content

Instantly share code, notes, and snippets.

@danmack
Last active September 1, 2024 03:45
Show Gist options
  • Save danmack/53eaea4353d6b3dcfd20238741557290 to your computer and use it in GitHub Desktop.
Save danmack/53eaea4353d6b3dcfd20238741557290 to your computer and use it in GitHub Desktop.
Podman Rootless on Alpine Linux

How to do rootless Podman on Alpine Linux

Using recent podman (3.x) on 5.10.x Alpine Linux Kernels

apk add podman util-linux

enable and start the cgroups and podman services

rc-update add cgroups
rc-update add podman
rc-service cgroups start
rc-service podman start

edit /etc/subuid and /etc/subgid, add mappings starting at 200000 or greater

load needed kernel modules

modprobe tun
modprobe fuse

test it out

podman unshare cat /proc/self/uid_map
       0       1024          1
       1     200000      65536

If you get this error:

% podman ps -a
Error: cannot re-exec process to join the existing user namespace

Try removing or examing your ~/.xdg/runtime hierarchy. That fixed it for me after looking at lots of strace logs I was not able to explain why it was not working.

@jdrowell
Copy link

rc-server -> rc-service

@danmack
Copy link
Author

danmack commented Dec 12, 2022

Thank you, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment