RHCSA RHCSA Containers and Podman 1 — Questions and Answers
Question 1: Which command searches for a container image named 'nginx' in configured Podman registries?
- podman find nginx
- podman search nginx (Correct answer)
- podman lookup nginx
- podman pull --search nginx
Correct answer: podman search nginx
'podman search nginx' queries configured registries and returns matching image names, descriptions, and stars.
Question 2: How do you run a container in detached (background) mode using Podman?
- podman run --background nginx
- podman run -b nginx
- podman run -d nginx (Correct answer)
- podman run --daemon nginx
Correct answer: podman run -d nginx
The '-d' flag (detached) runs the container in the background and prints the container ID.
Question 3: Which command lists all containers, including stopped ones, in Podman?
- podman ps
- podman ps -a (Correct answer)
- podman list --all
- podman containers show
Correct answer: podman ps -a
'podman ps -a' shows all containers regardless of state; without '-a' only running containers are shown.
Question 4: What command downloads the 'ubi8' image from a registry to local storage?
- podman get ubi8
- podman fetch ubi8
- podman download ubi8
- podman pull ubi8 (Correct answer)
Correct answer: podman pull ubi8
'podman pull ubi8' downloads the image from the configured registry to the local image store.
Question 5: Which command removes a stopped container named 'myapp' in Podman?
- podman delete myapp
- podman rm myapp (Correct answer)
- podman remove myapp
- podman container purge myapp
Correct answer: podman rm myapp
'podman rm myapp' removes a stopped container; use '-f' to force-remove a running container.
Question 6: How do you display the standard output logs of a running container named 'webserver'?
- podman output webserver
- podman inspect webserver --logs
- podman logs webserver (Correct answer)
- podman show logs webserver
Correct answer: podman logs webserver
'podman logs webserver' fetches the STDOUT/STDERR logs of the specified container.
Question 7: Which command stops a running Podman container named 'db' gracefully?
- podman kill db
- podman halt db
- podman stop db (Correct answer)
- podman end db
Correct answer: podman stop db
'podman stop db' sends SIGTERM to the container process, then SIGKILL after a timeout if it hasn't exited.
Which command searches for a container image named 'nginx' in configured Podman registries?