Podman : Use by common users2026/05/07 |
|
It's possible to use Podman containers by common users. |
|
| [1] | By default, sub UID/GID that are used on user name spaces are assigned to run containers. |
|
# sub UID/GID mapping file # 100000 to 165535 (100000 + 65536 - 1) UID are used for running processes in containers on [ubuntu] user root@dlp:~# cat /etc/subuid ubuntu:100000:65536 root@dlp:~# cat /etc/subgid ubuntu:100000:65536 # when added new users, sub UID/GID are also added # n=0, n++ # [start UID/GID = 100000 + (65536 * n)] # [end UID/GID = (start UID/GID) + 65536 - 1] root@dlp:~# useradd resolute root@dlp:~# useradd raccoon root@dlp:~# cat /etc/subgid /etc/subgid ubuntu:100000:65536 resolute:165536:65536 raccoon:231072:65536 ubuntu:100000:65536 resolute:165536:65536 raccoon:231072:65536 |
| [2] | It's possible to run [podman] by common users. |
|
ubuntu@dlp:~$ podman pull ubuntu ubuntu@dlp:~$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/library/ubuntu latest 30ba44506a6d 2 weeks ago 111 MB
ubuntu@dlp:~$
podman run ubuntu echo "run rootless containers" run rootless containers # containers related files are located under the [$HOME/.local] directory ubuntu@dlp:~$ ll ~/.local/share/containers/storage total 168 drwx------ 9 ubuntu ubuntu 4096 May 7 01:02 ./ drwx------ 4 ubuntu ubuntu 4096 May 7 00:58 ../ -rw-r--r-- 1 ubuntu ubuntu 126976 May 7 01:02 db.sql -rw-r--r-- 1 ubuntu ubuntu 8 May 7 00:58 defaultNetworkBackend drwx------ 2 ubuntu ubuntu 4096 May 7 00:58 libpod/ drwx------ 2 ubuntu ubuntu 4096 May 7 00:58 networks/ drwx------ 6 ubuntu ubuntu 4096 May 7 01:02 overlay/ drwx------ 3 ubuntu ubuntu 4096 May 7 01:02 overlay-containers/ drwx------ 3 ubuntu ubuntu 4096 May 7 00:58 overlay-images/ drwx------ 2 ubuntu ubuntu 4096 May 7 01:02 overlay-layers/ -rw-r--r-- 1 ubuntu ubuntu 64 May 7 01:02 storage.lock -rw-r--r-- 1 ubuntu ubuntu 0 May 7 00:58 userns.lock drwx------ 2 ubuntu ubuntu 4096 May 7 00:58 volumes/ # possible to create Pods ubuntu@dlp:~$ podman pod create -p 8081:80 -n test-pod ubuntu@dlp:~$ podman pod ls POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS b214e57bf970 test-pod Created 3 seconds ago 4a3c790da7bb 1 # for port mapping, # it's impossible to use less than [1024] ports on Host machine by common users # possible to use over [1024] ports ubuntu@dlp:~$ podman run -itd -p 1023:80 ubuntu /bin/bash Error: pasta failed with exit code 1: Listen failed for HOST TCP port */1023: Permission denied Couldn't listen on requested TCP ports podman run -itd -p 1024:80 ubuntu /bin/bash ubuntu@dlp:~$ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8f62109469b6 docker.io/library/ubuntu:latest /bin/bash 3 seconds ago Up 4 seconds 0.0.0.0:1024->80/tcp peaceful_maxwell |
| Sponsored Link |
|
|