janken
janken

Reputation: 21

podman cannot see all running containers

At the job just started using containers. Putting 10 seconds of thought into the set up, I built out a RHEL 8 system using podman. There are two different non-root users running containers. Running "podman ps" as each user sees running containers, grand total of 3. root sees nothing running. Why? Shouldn't root be able to see a running container same as the owners? I have found nothing to indicate that this should happen or is just a rookie mistake. Any documents would help.

Upvotes: 2

Views: 5747

Answers (1)

Davide Madrisan
Davide Madrisan

Reputation: 2320

A user is only able to list the containers that belong to that user. So root sees no containers running if they all have been run by non-root users.

We only way to list all the running container IDs that I've found is by executing the following command:

$ sudo find /var/run/crun/ /var/run/user/ -type f -name status 2>/dev/null 
/var/run/crun/dfdd7076246d758a144a269a32eed89270c55e4a09c6b8a75162f5e01d054871/status
/var/run/user/1000/crun/41f5a7c3724932e2520340c3176ed5d1bed19fcefeaff3e474ffc20c23c67052/status
/var/run/user/1000/crun/9b7a2b1fd9463219258b8753bf2a77d440a37f6f9768f3abcc8a7a2777e54719/status

Tested on Fedora 35 and podman 3.4.1

Upvotes: 1

Related Questions