RHCE Containers and Podman 1 — Questions and Answers
Question 1: What is the primary container tool used in RHEL 8+ instead of Docker?
- LXC
- Podman (Correct answer)
- rkt
- containerd
Correct answer: Podman
Red Hat replaced Docker with Podman in RHEL 8, offering a daemonless, rootless container experience compatible with Docker CLI syntax.
Question 2: Which command runs a container from the `ubi8` image interactively with a bash shell?
- podman start -it ubi8 bash
- podman run -it ubi8 bash (Correct answer)
- podman exec -it ubi8 bash
- podman create -it ubi8 bash
Correct answer: podman run -it ubi8 bash
`podman run -it` creates and starts a container interactively (`-i`) with a pseudo-terminal (`-t`) and runs bash.
Question 3: What is a key advantage of Podman over Docker in RHEL?
- Requires a root daemon to manage containers
- Supports rootless containers without a background daemon (Correct answer)
- Only supports privileged containers
- Cannot run systemd services inside containers
Correct answer: Supports rootless containers without a background daemon
Podman is daemonless and supports rootless containers, improving security by not requiring a privileged background service.
Question 4: Which command lists all running containers in Podman?
- podman images
- podman ps (Correct answer)
- podman list
- podman containers
Correct answer: podman ps
`podman ps` lists all currently running containers, similar to `docker ps`.
Question 5: What command pulls the `httpd` image from the Red Hat registry?
- podman pull registry.access.redhat.com/ubi8/httpd-24 (Correct answer)
- podman get httpd
- podman fetch httpd:latest
- podman download httpd
Correct answer: podman pull registry.access.redhat.com/ubi8/httpd-24
`podman pull` downloads a container image from a specified registry, using the full image path for Red Hat registries.
Question 6: Which Podman command maps host port 8080 to container port 80?
- podman run -e 8080:80 httpd
- podman run -p 8080:80 httpd (Correct answer)
- podman run --port 8080:80 httpd
- podman run -P 8080:80 httpd
Correct answer: podman run -p 8080:80 httpd
The `-p host_port:container_port` flag maps a host port to the container's internal port.
What is the primary container tool used in RHEL 8+ instead of Docker?