Courseiva

CCNA Container Operations And Lifecycle Questions

69 questions · Container Operations And Lifecycle · All types, answers revealed

1
MCQmedium

An administrator needs to copy a configuration file named /tmp/nginx.conf from the host into a running container named web_server at path /etc/nginx/nginx.conf. Which command should be used?

A.podman push --target web_server /tmp/nginx.conf
B.podman cp /tmp/nginx.conf web_server:/etc/nginx/nginx.conf
C.podman transfer /tmp/nginx.conf web_server:/etc/nginx/nginx.conf
D.podman import /tmp/nginx.conf web_server:/etc/nginx/nginx.conf
AnswerB

podman cp supports copying from host to container using host_path:container_path syntax.

Why this answer

podman cp copies files/folders between a container and the local filesystem.

2
Multi-Selectmedium

An administrator is troubleshooting a misbehaving container and needs to examine its output logs and event history. Which TWO commands are appropriate for this task? (Choose TWO)

Select 2 answers
A.podman inspect-logs
B.podman logs
C.podman events
D.podman history
E.podman trace
AnswersB, C

podman logs fetches standard output and error logs generated by the container.

Why this answer

podman logs retrieves container stdout/stderr, and podman events streams system-wide container events.

3
Multi-Selecthard

An administrator is troubleshooting process execution and live configuration updates on a running container. Which TWO commands allow interacting with processes or updating resource limits on the fly? (Choose TWO)

Select 2 answers
A.podman exec-top
B.podman adjust
C.podman update
D.podman modify
E.podman top
AnswersC, E

podman update modifies container resource limits like CPU shares on a running container.

Why this answer

podman top shows container processes, and podman update modifies container resources live.

4
MCQmedium

An administrator wants to monitor real-time Podman system events, such as when containers are created, started, stopped, or removed, for auditing purposes. Which command should be executed?

A.podman audit
B.podman system stream
C.podman events
D.podman monitor
AnswerC

The 'podman events' command listens to and prints real-time streaming events occurring within the Podman environment.

Why this answer

The 'podman events' command streams real-time events from the Podman system.

5
Multi-Selectmedium

An administrator is managing rootless Podman containers as a non-root user and wants to ensure that these containers automatically start upon system boot and persist across reboots using systemd. Which TWO steps or commands are required to accomplish this? (Choose TWO)

Select 2 answers
A.Configure the container restart policy to always using '--restart always' without systemd.
B.Run 'systemctl enable --now podman' with root privileges.
C.Modify the global '/etc/rc.local' script to execute 'podman start' on boot.
D.Run 'loginctl enable-linger <username>' to allow the user's systemd instance to run in the background when not logged in.
E.Generate a user systemd unit file using 'podman generate systemd' and place it in '~/.config/systemd/user/'.
AnswersD, E

Lingering is mandatory for rootless containers managed by user systemd to start at boot without an active user session.

Why this answer

Rootless Podman persistence via systemd requires lingering to be enabled for the user so systemd runs when they are logged out, and generating/enabling a systemd service file.

6
MCQmedium

A container named db_master was previously paused using podman pause. Which command should the administrator use to resume its execution?

A.podman start db_master
B.podman resume db_master
C.podman unpause db_master
D.podman thaw db_master
AnswerC

podman unpause resumes the execution of processes in a paused container.

Why this answer

podman unpause unfreezes the processes within the paused container.

7
MCQhard

An administrator wants to view real-time container lifecycle events across the entire Podman system, such as container creation, starting, and stopping. Which command should be executed?

A.podman monitor --stream
B.podman events
C.podman logs --follow --events
D.podman system trace
AnswerB

podman events streams real-time events from the Podman system.

Why this answer

The podman events command monitors container events in real time.

8
MCQhard

An administrator needs to view the processes running inside a specific container named worker_node, along with custom ps options like -ef to see full command arguments. Which command accomplishes this?

A.podman ps --processes worker_node
B.podman exec worker_node ps -ef
C.podman inspect --processes worker_node
D.podman top worker_node -ef
AnswerD

podman top accepts standard ps options after the container name to customize output.

Why this answer

podman top displays the running processes of a container and accepts ps-compatible argument flags.

9
MCQeasy

An administrator needs to start a container named webapp from the image docker.io/library/httpd in the background. Which podman command should be used?

A.podman run -d --name webapp docker.io/library/httpd
B.podman up -d --name webapp docker.io/library/httpd
C.podman container create -d --name webapp docker.io/library/httpd
D.podman start -d docker.io/library/httpd --name webapp
AnswerA

podman run creates and starts a container from an image, and -d runs it in detached mode.

Why this answer

The podman run command with the -d (detached) flag starts a container in the background.

10
MCQhard

An administrator is troubleshooting container startup failures and wants to inspect the exact entrypoint and command arguments configured for a container named app_run before it starts. Which inspect format expression retrieves this?

A.podman ps --format='{{.Command}}' app_run
B.podman inspect --format='{{.State.Command}}' app_run
C.podman inspect --format='{{.Config.Entrypoint}} {{.Config.Cmd}}' app_run
D.podman inspect --format='{{.Args}}' app_run
AnswerC

This inspect format string retrieves both the entrypoint and command configurations.

Why this answer

The entrypoint and command arguments are stored in .Config.Entrypoint and .Config.Cmd.

11
MCQhard

An administrator wants to generate a systemd unit file for an existing Podman container named 'app_server' so that it can be managed as a system service. Which command should be used to generate this unit file and write it directly to the user systemd directory?

A.podman export systemd app_server > /etc/systemd/system/app_server.service
B.podman service generate --container app_server --output ~/.config/systemd/user/
C.podman generate systemd --new --files --name app_server
D.podman systemd create --name app_server > ~/.config/systemd/user/container-app_server.service
AnswerC

The 'podman generate systemd' command with '--new' and '--files' writes the unit file directly into the current working directory, which can then be moved to the systemd folder.

Why this answer

The 'podman generate systemd' command is used to create systemd unit files, and the '--new' flag ensures the unit file creates a new container on start rather than relying on an existing stopped container.

12
Multi-Selecthard

An administrator is configuring container health checks and wants to review health status or force immediate actions. Which TWO of the following statements or commands are accurate regarding Podman health checks? (Choose TWO)

Select 2 answers
A.podman inspect --format='{{json .State.Health.Status}}' can be used to check container health status.
B.Health checks can be configured during container creation using the --health-cmd option.
C.Container health statuses are automatically logged to /var/log/podman-health.log on the host.
D.podman stop automatically triggers a health check before shutting down.
E.podman health-check status is a valid built-in standalone top-level command.
AnswersA, B

This inspect command successfully extracts the health status string from container metadata.

Why this answer

podman inspect with health format templates can retrieve health status, and health checks can be defined at run time using --health-cmd.

13
MCQmedium

An administrator has a container that failed to start correctly. They want to inspect the exit code and finished timestamp. Which inspect format string provides the finished time?

A.podman inspect --format='{{.State.FinishedAt}}' failed_app
B.podman inspect --format='{{.Time.Ended}}' failed_app
C.podman inspect --format='{{.Finished}}' failed_app
D.podman ps --format='{{.FinishedAt}}' failed_app
AnswerA

.State.FinishedAt provides the timestamp when the container last stopped.

Why this answer

Container lifecycle timestamps such as FinishedAt are stored under .State.

14
MCQhard

An administrator is using Podman Quadlets to manage containers via systemd. Where must the Quadlet .container configuration file be placed for system-wide root containers?

A./etc/systemd/system/containers/
B./etc/containers/systemd/
C./var/lib/containers/systemd/quadlets/
D./etc/systemd/system/
AnswerB

System-wide Quadlet configuration files reside in /etc/containers/systemd/.

Why this answer

System-wide Quadlet files are placed in /etc/containers/systemd/.

15
Multi-Selecthard

An administrator is working with Podman Quadlets to manage container lifecycles via systemd. Which TWO statements regarding Quadlet file naming conventions and directory locations are correct? (Choose TWO)

Select 2 answers
A.Rootless Quadlet files are placed in /var/lib/containers/systemd/ root directory.
B.Quadlet configuration files are automatically translated into native systemd unit files by Podman generators.
C.System-wide Quadlet configuration files are placed in /etc/containers/systemd/.
D.Quadlet files must be manually compiled using gcc before systemd can read them.
E.Quadlet container unit files must use the exact file extension .service.container.
AnswersB, C

Quadlet generator tools parse .container and other Quadlet files and generate corresponding systemd unit files on the fly.

Why this answer

Quadlet configuration files use specific extensions like .container and system-wide files reside in /etc/containers/systemd/.

16
Multi-Selectmedium

An administrator needs to export container contents or create new images from containers. Which TWO commands accomplish these actions? (Choose TWO)

Select 2 answers
A.podman extract
B.podman push-container
C.podman commit
D.podman export
E.podman save
AnswersC, D

podman commit creates a new image from a container's changes.

Why this answer

podman export exports a container filesystem to a tarball, and podman commit creates an image from a container.

17
Multi-Selecthard

An administrator is managing rootless containers and needs to understand how user namespaces and security isolation function. Which TWO of the following configuration files or tools are directly relevant to rootless user mapping and systemd user persistence? (Choose TWO)

Select 2 answers
A.systemctl system-wide-users
B./etc/containers/rootless.conf
C./var/lib/podman/subuid.conf
D./etc/subuid and /etc/subgid
E.loginctl enable-linger
AnswersD, E

These files define the subordinate UID and GID ranges allocated for rootless user namespaces.

Why this answer

/etc/subuid defines subordinate UID ranges, and loginctl enable-linger configures user session persistence for systemd user services.

18
Multi-Selectmedium

An administrator wants to examine the internal state, environment variables, or port mappings of a running container. Which TWO commands or techniques are appropriate? (Choose TWO)

Select 2 answers
A.podman port
B.podman list-ports
C.podman inspect
D.podman env
E.podman show-env
AnswersA, C

podman port lists public port mappings for the container.

Why this answer

podman inspect retrieves low-level metadata, and podman port displays mapped network ports.

19
MCQeasy

An administrator wants to immediately stop and remove a running container named temp_test in a single command. Which command should be used?

A.podman kill --remove temp_test
B.podman delete --force temp_test
C.podman stop --rm temp_test
D.podman rm -f temp_test
AnswerD

The -f or --force flag forces the removal of a running container (it stops it and removes it).

Why this answer

The --rm flag with run automatically removes containers upon exit, but to remove an existing running container immediately, podman rm with -f can be used.

20
MCQhard

An administrator wants to run a container with a custom health check command that disables health checking entirely for a container that inherited one from its base image. Which flag achieves this?

A.--health-enabled=false
B.--health-cmd=none
C.--disable-health
D.--no-healthcheck
AnswerB

Passing none to --health-cmd disables any health check defined in the image.

Why this answer

Setting --health-cmd=none disables the health check inherited from the base image.

21
Multi-Selectmedium

An administrator wants to modify container settings or state. Which TWO of the following commands are valid Podman subcommands for container management? (Choose TWO)

Select 2 answers
A.podman reconfigure
B.podman alter
C.podman modify
D.podman restart
E.podman rename
AnswersD, E

podman restart stops and starts a container.

Why this answer

podman rename and podman restart are valid subcommands.

22
MCQhard

An administrator is working with a rootless Podman setup and needs to ensure that container user namespaces map UIDs correctly such that container root (UID 0) maps to the unprivileged user's UID on the host. Which file configures subordinate UID mappings for rootless users on RHEL?

A./etc/subuid and /etc/subgid
B./etc/containers/userns.conf
C./etc/security/limits.conf
D./etc/passwd and /etc/group
AnswerA

/etc/subuid and /etc/subgid define the subordinate user and group ID ranges allocated for user namespaces.

Why this answer

Rootless user namespaces rely on /etc/subuid and /etc/subgid for mapping ranges.

23
MCQeasy

An administrator wants to view the last 50 lines of logs for a running container named log_test and keep the log stream open for new entries. Which command should be used?

A.podman tail 50 log_test
B.podman log-stream --lines=50 log_test
C.podman inspect --tail=50 log_test
D.podman logs --tail 50 --follow log_test
AnswerD

--tail 50 limits output to the last 50 lines, and --follow streams new log additions in real-time.

Why this answer

The --tail and --follow (or -f) flags in podman logs control line limits and streaming.

24
MCQhard

A container named api_gw is configured with a health check. An administrator needs to check the current health status (e.g., healthy, unhealthy, starting) using the command line without reading the full inspect JSON. Which command string achieves this?

A.podman inspect --format='{{json .State.Health.Status}}' api_gw
B.podman health status api_gw
C.podman ps --filter health=unhealthy
D.podman status api_gw
AnswerA

This inspect command uses a Go template to extract the exact health status string from the container state.

Why this answer

Using format strings with podman inspect allows extracting specific fields like the health status directly.

25
MCQhard

An administrator needs to update the CPU shares (cpu-shares) of a running container named compute_job on the fly without stopping it. Which command should be used?

A.podman update --cpu-shares 512 compute_job
B.podman config compute_job cpu-shares=512
C.podman modify --cpu-shares 512 compute_job
D.podman set --shares=512 compute_job
AnswerA

podman update allows live modification of container resource limits such as CPU shares.

Why this answer

podman update modifies container configuration resources on a running container.

26
MCQhard

A container named 'worker' was configured with a health check command during build time, but an administrator needs to temporarily override or define a new health check command while running the container. Which flag should be passed to 'podman run' to achieve this?

A.--check-command
B.--healthcheck-run
C.--health-cmd
D.--health-test
AnswerC

The '--health-cmd' option specifies the command to run to check container health at runtime.

Why this answer

The '--health-cmd' flag allows defining or overriding the health check command when starting a container.

27
MCQeasy

An operator needs to troubleshoot a failing service inside a container named 'auth_api'. Which command should the operator run to view the standard output log stream generated by this container?

A.podman output auth_api
B.podman logs auth_api
C.podman events auth_api
D.podman history auth_api
AnswerB

The 'podman logs' command retrieves the standard output and standard error logs of the specified container.

Why this answer

The 'podman logs' command fetches the logs generated by a container.

28
MCQeasy

A running Podman container named 'dbapp' is unresponsive, and a technician needs to immediately and forcefully terminate it without waiting for a graceful shutdown timeout. Which Podman command should be executed?

A.podman stop --force dbapp
B.podman kill dbapp
C.podman terminate dbapp
D.podman rm -f dbapp
AnswerB

The 'podman kill' command sends the SIGKILL signal to the container's init process, stopping it immediately.

Why this answer

The 'podman kill' command immediately stops the container using the KILL signal, whereas 'podman stop' attempts a graceful shutdown first.

29
MCQhard

An administrator wants to retrieve only the IP address of a running container named web_svc by querying podman inspect with a specific format template. Which command is correct?

A.podman ps --format='{{ .IP }}' web_svc
B.podman inspect --ip web_svc
C.podman inspect --format='{{ .NetworkSettings.IPAddress }}' web_svc
D.podman inspect --query=ip web_svc
AnswerC

This template extracts the primary IP address assigned to the container.

Why this answer

Go templates in podman inspect can target network settings, such as .NetworkSettings.IPAddress.

30
MCQmedium

An administrator wants to monitor resource usage (CPU, memory, block I/O, network I/O) of all running containers in real-time. Which command provides this functionality?

A.podman stats
B.podman monitor resources
C.podman top
D.podman system df
AnswerA

podman stats streams resource utilization metrics for running containers.

Why this answer

podman stats displays a live stream of resource usage statistics for containers.

31
Multi-Selecteasy

An administrator needs to manage container lifecycles in Podman. Which TWO of the following commands can be used to start an existing, stopped container? (Choose TWO)

Select 2 answers
A.podman exec
B.podman run
C.podman start
D.podman up
E.podman restart
AnswersC, E

podman start explicitly boots up an existing stopped container.

Why this answer

podman start and podman restart (which starts a stopped or running container) can be used to start stopped containers. podman run creates a new container, and podman exec runs commands in running containers.

32
MCQmedium

An administrator needs to run a container named 'web01' using Podman in the background using the image registry.access.redhat.com/ubi8/httpd-24:latest. Which command correctly starts this container in detached mode and maps port 8080 on the host to port 80 in the container?

A.podman start -d --name web01 -p 8080:80 registry.access.redhat.com/ubi8/httpd-24:latest
B.podman container create -d --name web01 -p 8080:80 registry.access.redhat.com/ubi8/httpd-24:latest
C.podman run -d --name web01 -p 8080:80 registry.access.redhat.com/ubi8/httpd-24:latest
D.podman run -b --name web01 -p 80:8080 registry.access.redhat.com/ubi8/httpd-24:latest
AnswerC

This command correctly specifies detached mode, container naming, port forwarding, and the target image.

Why this answer

The correct command uses 'podman run -d' for detached mode, '--name web01' to set the name, '-p 8080:80' for port mapping, and the correct image reference.

33
Multi-Selecteasy

An administrator wants to check container port mappings and process listings inside containers. Which TWO commands provide these insights? (Choose TWO)

Select 2 answers
A.podman port
B.podman ps-ports
C.podman processes
D.podman top
E.podman netstat
AnswersA, D

podman port displays public port mappings for a container.

Why this answer

podman port shows port mappings and podman top shows running processes.

34
MCQeasy

An administrator needs to view all network ports exposed or mapped by a container named web_prod using a simplified summary command. Which command can be used?

A.podman port web_prod
B.podman show-ports web_prod
C.podman network list-ports web_prod
D.podman inspect --ports web_prod
AnswerA

podman port lists the port mappings for the specified container.

Why this answer

podman port displays public port mappings for a container.

35
MCQeasy

An administrator needs to pause all processes inside a running container named db_master without stopping it. Which command accomplishes this?

A.podman suspend db_master
B.podman freeze db_master
C.podman hold db_master
D.podman pause db_master
AnswerD

podman pause uses the cgroups freezer to suspend all processes inside the container.

Why this answer

podman pause suspends all processes in the specified container.

36
MCQeasy

An administrator needs to check the disk space consumption of all containers, images, and volumes managed by Podman. Which command should be run?

A.podman storage show
B.podman system df
C.podman disk usage
D.podman inspect --disk
AnswerB

podman system df reports disk space utilization similar to the standard Unix df utility.

Why this answer

podman system df shows disk usage by Podman objects.

37
Multi-Selectmedium

An administrator wants to temporarily pause a running container's processes and later resume them. Which TWO commands should be used? (Choose TWO)

Select 2 answers
A.podman unpause
B.podman pause
C.podman freeze
D.podman resume
E.podman stop
AnswersA, B

podman unpause resumes execution of a paused container.

Why this answer

podman pause suspends container processes, and podman unpause resumes them.

38
MCQmedium

An administrator wants to rename an existing stopped container from old_name to new_name. Which command should be used?

A.podman update --name new_name old_name
B.podman mv old_name new_name
C.podman modify --name new_name old_name
D.podman rename old_name new_name
AnswerD

podman rename changes the name of a container.

Why this answer

podman rename renames an existing container.

39
MCQmedium

An administrator wants to export the filesystem of a container named golden_image into a tar archive file named container_fs.tar. Which command should be used?

A.podman save -o container_fs.tar golden_image
B.podman backup golden_image --file container_fs.tar
C.podman archive golden_image container_fs.tar
D.podman export -o container_fs.tar golden_image
AnswerD

podman export packages a container's filesystem contents into a tar archive.

Why this answer

podman export exports a container's filesystem as a tar archive.

40
Multi-Selecteasy

An administrator needs to inspect running containers and their resource consumption. Which TWO commands provide information about running container state or resource usage? (Choose TWO)

Select 2 answers
A.podman storage
B.podman stats
C.podman ps
D.podman images
E.podman network ls
AnswersB, C

podman stats streams real-time CPU, memory, and I/O utilization for containers.

Why this answer

podman ps lists containers, and podman stats displays live resource usage statistics.

41
MCQeasy

An administrator needs to remove all stopped containers from the system to free up disk space in a single command. Which command should be used?

A.podman rm stopped
B.podman container prune
C.podman system clean
D.podman rm --all
AnswerB

podman container prune deletes all stopped containers after prompting for confirmation (or use -f to skip prompt).

Why this answer

podman container prune removes all stopped containers.

42
MCQmedium

An administrator needs to inspect low-level configuration, network settings, and state details of a running container named redis_cache in JSON format. Which command provides this?

A.podman show redis_cache
B.podman details redis_cache
C.podman inspect redis_cache
D.podman query --json redis_cache
AnswerC

podman inspect outputs comprehensive JSON-formatted metadata about the container.

Why this answer

podman inspect provides detailed configuration and state information about containers, images, and other objects in JSON.

43
Multi-Selecthard

A container named 'app_prod' is currently running, and an operator needs to troubleshoot its current configuration, network settings, and mounted volumes in detail. Which THREE commands or approaches can retrieve this information? (Choose THREE)

Select 3 answers
A.Run 'podman inspect app_prod' to output comprehensive JSON-formatted metadata regarding configuration, mounts, and network settings.
B.Run 'podman config app_prod' to print a summary of environment variables and limits.
C.Run 'podman top app_prod' to display the processes running inside the container.
D.Run 'podman port app_prod' to view the current port mappings between the host and the container.
E.Run 'podman diff app_prod' to view changes to the container's file system, which is primarily used for tracking modifications rather than initial configuration.
AnswersA, C, D

The 'podman inspect' command outputs detailed configuration information in JSON format.

Why this answer

Podman provides several ways to inspect running containers, including 'podman inspect', 'podman port', and 'podman exec' / 'podman top'.

44
MCQmedium

A container named app_server is running and consuming excessive CPU. An administrator needs to gracefully stop this container with a 30-second timeout before forcing termination. Which command accomplishes this?

A.podman kill --signal SIGTERM --timeout 30 app_server
B.podman halt -s 30 app_server
C.podman stop --time 30 app_server
D.podman terminate --grace-period=30 app_server
AnswerC

The --time (or -t) flag sets the seconds to wait for stop before killing the container.

Why this answer

The podman stop command stops one or more running containers and accepts a -t or --time option to specify the seconds to wait before killing the container.

45
MCQmedium

An administrator needs to restart a running container named app_v1 so that configuration changes take effect. Which command performs a container restart?

A.podman reload app_v1
B.podman restart app_v1
C.podman cycle app_v1
D.podman refresh app_v1
AnswerB

podman restart restarts the specified container.

Why this answer

podman restart stops and then restarts a container.

46
MCQhard

An administrator is troubleshooting container exit codes. A container exited with code 137. What does this specific exit code typically signify in container engines?

A.The container was terminated forcefully by SIGKILL (often due to Out-Of-Memory).
B.The container executed an invalid system call blocked by seccomp.
C.The container encountered an application-level syntax error.
D.The container startup script had a permission denied error.
AnswerA

Signal 9 (SIGKILL) added to base 128 results in 137, commonly triggered by the kernel OOM killer.

Why this answer

Exit code 137 indicates that the container process was terminated forcibly by the OOM killer or SIGKILL (128 + 9).

47
Multi-Selecthard

An administrator is troubleshooting container exit codes and low-level state details. Which TWO of the following inspect format expressions correctly extract container state attributes? (Choose TWO)

Select 2 answers
A.podman inspect --format='{{.Metadata.ExitCode}}' container_name
B.podman inspect --format='{{.State.StartedAt}}' container_name
C.podman inspect --format='{{.Status.Running}}' container_name
D.podman inspect --format='{{.Exit}}' container_name
E.podman inspect --format='{{.State.ExitCode}}' container_name
AnswersB, E

This retrieves the timestamp when the container was started.

Why this answer

.State.ExitCode and .State.StartedAt are valid Go template expressions for podman inspect.

48
MCQmedium

An administrator wants to run a one-off command (/bin/sh) interactively inside an existing running container named legacy_app. Which command should be used?

A.podman run -it legacy_app /bin/sh
B.podman enter legacy_app /bin/sh
C.podman attach legacy_app --shell=/bin/sh
D.podman exec -it legacy_app /bin/sh
AnswerD

podman exec -it runs an interactive shell inside the target running container.

Why this answer

podman exec runs a new command inside a running container, and -it allows interactive terminal access.

49
MCQeasy

An administrator needs to commit the changes made to a running container named test_lab into a new image named my_custom_img:latest. Which command should be used?

A.podman commit test_lab my_custom_img:latest
B.podman create-image test_lab my_custom_img:latest
C.podman save test_lab my_custom_img:latest
D.podman build --container test_lab -t my_custom_img:latest
AnswerA

podman commit captures container changes and saves them as a new container image.

Why this answer

podman commit creates a new image from a container's changes.

50
MCQmedium

An administrator has created a systemd service file named container-web.service using podman generate systemd. Where should this file be placed for a rootless user to manage it as a user-level service?

A.~/.local/share/podman/systemd/
B./etc/systemd/system/
C.~/.config/systemd/user/
D./var/lib/containers/systemd/
AnswerC

Rootless user services are managed by user systemd instances reading from ~/.config/systemd/user/.

Why this answer

Rootless systemd service files for user sessions must be placed in the user's systemd user directory.

51
Multi-Selecteasy

An administrator needs to clean up stopped containers and unused data to reclaim disk space. Which TWO commands can be used to remove containers? (Choose TWO)

Select 2 answers
A.podman image prune
B.podman rmi
C.podman rm
D.podman system clean
E.podman container prune
AnswersC, E

podman rm removes one or more specified containers.

Why this answer

podman rm removes specified containers, and podman container prune removes all stopped containers.

52
MCQeasy

An administrator needs to attach to the terminal of a currently running container named backend_app to view its active console output interactively. Which command should be used?

A.podman console backend_app
B.podman connect backend_app
C.podman attach backend_app
D.podman join backend_app
AnswerC

podman attach connects to the running container's primary process streams.

Why this answer

podman attach connects local standard input, output, and error streams to a running container.

53
MCQhard

An administrator is configuring a systemd service using podman generate systemd and wants the generated service to stop and remove the container automatically when the service stops, and create a fresh container when it starts. Which flag should be added?

A.--ephemeral
B.--new
C.--recreate
D.--auto-remove
AnswerB

The --new flag generates unit files that build/run a fresh container instance upon service startup.

Why this answer

The --new flag tells podman generate systemd to create a unit file that runs podman run (creating a new container) rather than podman start (using an existing container).

54
MCQeasy

An administrator wants to view a list of all running containers in a clean, tabular format without stopping containers or showing extra metadata. Which command should be used?

A.podman ps
B.podman show running
C.podman list
D.podman containers
AnswerA

podman ps displays running containers in a clear table format.

Why this answer

podman ps lists running containers by default.

55
MCQhard

An administrator is managing rootless containers and wants to enable systemd linger for their user account so that user-level container services continue running after the user logs out. Which command should be run?

A.systemctl enable --user --linger
B.podman system linger enable
C.usermod --linger=true $USER
D.loginctl enable-linger
AnswerD

loginctl enable-linger allows a user's systemd instance to run persistently even when logged out.

Why this answer

loginctl enable-linger enables systemd user services to persist after logout for rootless users.

56
Multi-Selecteasy

An administrator needs to manage multiple containers simultaneously using Podman. Which THREE actions can be performed directly using Podman commands? (Choose THREE)

Select 3 answers
A.Stop all running containers using 'podman stop $(podman ps -q)'.
B.Directly edit a running container's image tag using 'podman edit --tag'.
C.Instantly migrate a running container to a remote physical server using 'podman migrate'.
D.Remove all stopped containers using 'podman container prune'.
E.Restart a specific container using 'podman restart <container_name>'.
AnswersA, D, E

Combining 'podman stop' with the container IDs returned by 'podman ps -q' stops all active containers.

Why this answer

Podman allows batch operations such as stopping all containers, starting all containers, or removing all stopped containers using pruning and filtering options.

57
Multi-Selectmedium

An administrator needs to copy files between the host system and a running container. Which TWO syntax forms or commands are correct when using podman cp? (Choose TWO)

Select 2 answers
A.podman cp --target=container_name host_file.txt /app/file.txt
B.podman cp --direction=to-container host_file.txt container_name:/app/
C.podman cp container_name:/app/file.txt host_file.txt
D.podman cp host_file.txt container_name:/app/file.txt
E.podman cp --from=container_name /app/file.txt host_file.txt
AnswersC, D

This copies a file from the container to the host.

Why this answer

podman cp supports both host_path container_path and container_path host_path copy directions.

58
MCQmedium

An administrator wants to forcefully kill a running container named runaway_job immediately by sending the SIGKILL signal. Which command should be used?

A.podman kill runaway_job
B.podman terminate runaway_job
C.podman halt runaway_job
D.podman stop --force runaway_job
AnswerA

podman kill sends SIGKILL (or a specified signal) to the container's primary process immediately.

Why this answer

podman kill sends signals to containers, defaulting to SIGKILL.

59
MCQmedium

An administrator needs to inspect container health check logs to determine why recent health checks failed for a container named app_prod. Which command displays the container's health check log history?

A.podman logs --health app_prod
B.podman health-log app_prod
C.podman events --health app_prod
D.podman inspect --format='{{json .State.Health.Log}}' app_prod
AnswerD

This inspect command extracts the array of recent health check execution records including exit codes and outputs.

Why this answer

inspecting State.Health.Log within podman inspect shows recent health check execution details and error outputs.

60
MCQmedium

A container named 'metrics' has been running for several hours, and an engineer needs to inspect its current resource consumption (CPU, memory, and network I/O usage). Which Podman command provides a live-updating stream of resource usage statistics for running containers?

A.podman inspect metrics
B.podman top metrics
C.podman system df metrics
D.podman stats metrics
AnswerD

The 'podman stats' command provides real-time CPU, memory, network, and block I/O usage statistics for containers.

Why this answer

The 'podman stats' command displays a live stream of resource usage statistics for specified containers.

61
Multi-Selecteasy

An administrator needs to stop and remove a running container in a single workflow. Which TWO of the following approaches accomplish this? (Choose TWO)

Select 2 answers
A.podman kill --remove container_name
B.podman rm -f container_name
C.podman delete --force container_name
D.podman stop --rm container_name
E.podman stop container_name followed by podman rm container_name
AnswersB, E

The -f flag forces removal of a running container by stopping it and removing it immediately.

Why this answer

podman rm -f forces removal of running containers (stopping them first), and stopping a container before running podman rm is also valid.

62
MCQmedium

An administrator needs to copy a directory named /app/logs from a running container named prod_app to the local host directory /var/backups/. Which command accomplishes this?

A.podman export --path /app/logs prod_app /var/backups/
B.podman pull prod_app:/app/logs /var/backups/
C.podman download prod_app:/app/logs /var/backups/
D.podman cp prod_app:/app/logs /var/backups/
AnswerD

podman cp prod_app:/app/logs /var/backups/ correctly extracts the directory from the container to the host.

Why this answer

podman cp supports copying from a container path to a host path using container_path:host_path syntax.

63
MCQeasy

An administrator needs to list all containers, including both running and stopped ones, on the system. Which command should be used?

A.podman ps -a
B.podman status --all
C.podman list --all
D.podman containers show
AnswerA

podman ps -a lists all containers regardless of their current state.

Why this answer

podman ps lists containers, and the -a or --all flag includes stopped containers.

64
MCQeasy

A container named db_cache has stopped unexpectedly. An administrator wants to see the standard output logs generated by this container prior to its exit. Which command should be used?

A.podman inspect --logs db_cache
B.podman logs db_cache
C.podman output db_cache
D.podman history db_cache
AnswerB

podman logs fetches the logged output from the container.

Why this answer

podman logs displays the logs of a container, including stopped ones, provided the logging driver captured them.

65
Multi-Selecthard

An administrator is integrating Podman containers with systemd using generated unit files. Which TWO statements are correct regarding podman generate systemd and its usage? (Choose TWO)

Select 2 answers
A.Running systemctl daemon-reload is unnecessary after generating a unit file because Podman reloads systemd automatically.
B.Generated systemd files for rootless users must always be placed in /etc/systemd/system/.
C.The --new flag ensures that the generated service creates a new container instance upon starting rather than requiring a pre-existing static container.
D.podman generate systemd can output unit files for both individual containers and pods.
E.Generated systemd unit files are executed exclusively by Docker daemon integration.
AnswersC, D

--new instructs the generated systemd unit to run podman run instead of podman start.

Why this answer

podman generate systemd creates systemd unit files, and the --new flag ensures unit files create fresh containers on startup rather than relying on existing static container names.

66
MCQhard

An administrator wants to find out which host port is mapped to port 80/tcp inside a running container named proxy_svr, using format templating with podman inspect. Which command accomplishes this?

A.podman ports proxy_svr
B.podman inspect --ports proxy_svr
C.podman ps --filter port=80
D.podman inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' proxy_svr
AnswerD

This template iterates over the port bindings and displays the mapping between container and host ports.

Why this answer

Port bindings are stored within NetworkSettings.Ports in the inspect JSON structure.

67
MCQhard

An administrator is troubleshooting a container that fails its health check repeatedly. The container definition needs a health check that runs curl -f http://localhost/ || exit 1 every 30s, with a 5s timeout and 3 retries, starting after a 10s grace period. Which flag combination implements this correctly in podman run?

A.podman run --healthcheck="curl -f http://localhost/" --interval=30 --timeout=5 --retries=3 webapp
B.podman run --health-probe="curl -f http://localhost/" --health-delay=10s webapp
C.podman run --health-cmd="curl -f http://localhost/ || exit 1" --health-interval=30s --health-timeout=5s --health-retries=3 --health-start-period=10s webapp
D.podman run --check-command="curl -f http://localhost/" --check-period=30s webapp
AnswerC

These are the correct exact flags for configuring container health checks in Podman.

Why this answer

The --health-cmd, --health-interval, --health-timeout, --health-retries, and --health-start-period options configure container health checks.

68
MCQeasy

An administrator wants to generate a systemd unit file for an existing container named web_frontend so it can be managed by systemd. Which command should be run?

A.systemctl enable --container web_frontend
B.podman generate systemd --new --name web_frontend
C.podman export systemd web_frontend
D.podman systemd generate --name web_frontend
AnswerB

podman generate systemd creates systemd service files, and --new specifies that unit files should create new containers rather than relying on existing ones.

Why this answer

podman generate systemd creates a systemd unit file for a container or pod.

69
Multi-Selecteasy

An administrator needs to view logs or attach to a running container to troubleshoot an issue. Which TWO commands can be used to interact with container output streams? (Choose TWO)

Select 2 answers
A.podman stream
B.podman view-logs
C.podman attach
D.podman output
E.podman logs
AnswersC, E

podman attach connects local terminal streams to the running container.

Why this answer

podman logs retrieves logged output, and podman attach connects to container input/output streams.

Ready to test yourself?

Try a timed practice session using only Container Operations And Lifecycle questions.