Containers

Why after running podman container run ubuntu the output of podman container ls is empty?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

Because the container immediately exits after running the ubuntu image. This is completely normal and expected as containers designed to run a service or a app and exit when they are done running it. To see the container you can run podman ps -a

If you want the container to keep running, you can run a command like sleep 100 which will run for 100 seconds or you can attach to terminal of the container with a command similar: podman container run -it ubuntu /bin/bash