CompTIA Linux+ Practice Questions: Containers

9 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering Containers, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock Linux+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

Containers practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

Q1. Which Docker command lists running containers?

  • A.docker ps✓ Correct
  • B.docker ls
  • C.docker containers
  • D.docker list
Explanation: docker ps shows active containers (add -a for all). Learn more.

Q2. What does 'podman pull' do?

  • A.Start a container
  • B.Download an image✓ Correct
  • C.Build an image
  • D.List containers
Explanation: pull fetches container images from registries. Learn more.

Q3. What does 'podman generate systemd' do?

  • A.Create container images
  • B.Generate systemd unit files for containers✓ Correct
  • C.Update Podman service
  • D.Check container health
Explanation: Creates systemd units to manage containers as services. Learn more.

Q4. What does 'podman build -t myimage .' do?

  • A.Create container from existing image
  • B.Build image from Dockerfile✓ Correct
  • C.Tag running container
  • D.Push image to registry
Explanation: Builds container image using current directory's Dockerfile. Learn more.

Q5. Which container command lists running Docker containers?

  • A.docker ps✓ Correct
  • B.docker buildx prune
  • C.docker login --help
  • D.docker volume create only
Explanation: docker ps lists currently running containers by default. Learn more.

Q6. Which container concept stores persistent data outside a container lifecycle?

  • A.Volume✓ Correct
  • B.Image tag only
  • C.Namespace only
  • D.Process ID
Explanation: Container volumes persist data independently of a specific running container instance. Learn more.

Q7. Which Linux kernel feature enforces CPU and memory resource limits for groups of container processes?

  • A.Control groups✓ Correct
  • B.File capabilities
  • C.Symbolic links
  • D.PAM stacks
Explanation: Control groups, or cgroups, account for and limit resources such as CPU time, memory, and I/O for process groups. Learn more.

Q8. What is the primary security benefit of running a container in rootless mode?

  • A.The image cannot contain any packages
  • B.The container engine does not require host root privileges✓ Correct
  • C.Networking is automatically disabled
  • D.The container becomes a virtual machine
Explanation: Rootless containers run the engine and container processes without host root privileges, reducing the impact of a container escape or engine flaw. Learn more.

Q9. Which command displays the detailed runtime configuration and metadata of a Podman container?

  • A.podman diff --metadata
  • B.podman build --show
  • C.podman inspect CONTAINER✓ Correct
  • D.podman system migrate --print
Explanation: podman inspect returns structured details such as image, environment, mounts, network settings, and current state for a container. Learn more.

More CompTIA Linux+ practice topics

Keep studying CompTIA Linux+

Full CompTIA Linux+ practice exam · CompTIA Linux+ study guide · All CompTIA practice questions

Last updated