Courseiva

305-300 · domain

Container Virtualization

This domain covers container virtualization on Linux, focusing on LXC, Docker, and systemd-nspawn. Candidates must manage container filesystems, snapshots, networking, and image metadata from the command line. Questions test practical command selection and configuration syntax rather than conceptual theory, so familiarity with real tooling and exact options is essential.

84 questions19 easy36 medium29 hard

Focused practice

Practice Container Virtualization questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Container Virtualization

You must be able to choose and run the correct container management command for filesystem snapshots, network driver selection, alternate root directories, and local image inspection. The most important thing is matching the exact tool and option to the task, especially LXC versus Docker versus systemd-nspawn.

Creating and restoring LXC container root filesystem snapshots with lxc-snapshot or lxc-copy

Selecting Docker network drivers such as macvlan for containers needing physical network IPs

Specifying an alternate root directory in systemd-nspawn using the -D or --directory option

Inspecting Docker image metadata locally with docker inspect or docker image inspect

Why learners struggle

Why Container Virtualization questions are commonly missed

Learners often confuse Type 1 and Type 2 hypervisors, and misunderstand VM resource limits versus host capabilities. The abstract nature of virtualized hardware makes it hard to apply to real scenarios.

  • ·Type 1 vs Type 2 hypervisor — which runs directly on hardware.
  • ·Host vs guest OS — which controls physical resources.
  • ·Overcommitment — VM resources can exceed host physical limits.
  • ·Snapshot vs backup — snapshot is not a full backup.
  • ·Virtual switch vs physical switch — network isolation differences.
  • ·Hardware compatibility — guest OS may lack drivers for virtual hardware.

Watch out for

Common Container Virtualization exam traps

  • ▸Confusing LXC snapshot commands with Docker commit or image layering, leading to wrong tool selection for filesystem snapshots.
  • ▸Assuming Docker bridge networking gives containers physical network IPs; macvlan or ipvlan is required for that behavior.
  • ▸Forgetting that systemd-nspawn needs -D/--directory for a custom root, and instead passing the path as a bare argument.

Question index

All Container Virtualization questions (84)

Click any question to see the full explanation, or start a practice session above.

1

A system administrator is troubleshooting a container that cannot resolve DNS names for other containers on the same user-defined Docker bridge network. The container's /etc/resolv.conf points to 127.0.0.11. Which Docker feature is responsible for providing this DNS resolution?

Medium
2

Which TWO of the following are true regarding the differences between rkt (Rocket) and Docker?

Hard
3

In a FreeBSD Jail, how can you ensure the jail starts automatically at boot?

Hard
4

A Docker host runs a container with the default bridge network. The container needs to resolve external DNS names, but `docker exec mycontainer ping example.com` fails with 'unknown host'. The host itself resolves names correctly. Which Docker daemon configuration should you check first?

Medium
5

Which Docker network driver should you use if you want containers to have their own IP addresses on the physical network, as if they were physically connected to the network?

Medium
6

When building a Dockerfile, which instruction should be used to define the user context for subsequent RUN, CMD, and ENTRYPOINT instructions?

Easy
7

When configuring a systemd-nspawn container, what is the effect of the --private-network option?

Hard
8

A Docker container running a web server is unable to serve traffic on port 8080. You verify the Dockerfile exposes port 80. What is the correct way to map this for external access?

Medium
9

You are running a Docker container and need to map port 8080 on the host to port 80 in the container. Which command argument should you use?

Medium
10

Which Dockerfile instruction is used to copy a file from the host file system into the image?

Medium
11

Which THREE instructions in a Dockerfile can modify the image's filesystem?

Medium
12

You are using systemd-nspawn to run a container and need to allow it to use the host's network stack directly, without any network namespace isolation. Which option should you pass to systemd-nspawn?

Medium
13

You are configuring LXC and want to set a CPU limit for a container. Which cgroup parameter is used to specify the quota of CPU time in microseconds?

Medium
14

Which THREE networking modes are natively supported by Docker?

Hard
15

You are using systemd-nspawn to run a container and want to ensure that the container's processes are isolated from the host's process tree. Which option should you use?

Easy
16

Which THREE features are provided by Linux Namespaces in the context of containers?

Hard
17

What does the 'docker rm' command do?

Easy
18

A Docker container is failing to connect to an external database despite the host being able to ping it. You suspect a bridge networking issue. Which command allows you to inspect the current NAT rules created by Docker?

Medium
19

Which file is primarily responsible for defining the configuration and environment variables for an OpenVZ container?

Medium
20

You are using systemd-nspawn. How do you create an image of a container to be used as a template?

Hard
21

What is the primary function of a Docker Registry?

Medium
22

You are configuring a rootless Podman container that must persist data across container restarts and also needs to communicate with other containers on the same host using a user-defined network. Which two actions must you perform to achieve these goals? (Choose two.)

Hard
23

You are troubleshooting a Docker container that fails to start with the error message: 'Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting /proc: no such file or directory'. The host is running a recent Linux kernel and Docker is using the default runtime. What is the most likely cause?

Hard
24

You are configuring an LXC container and need to limit its CPU and memory usage. Which TWO of the following configuration options in the container's config file are valid for this purpose? (Choose two.)

Medium
25

When using 'docker-compose', which file format is used to define the services?

Medium
26

When using Docker volumes, which type of mount should you use if you want the data to persist on the host filesystem at a specific, user-defined path?

Medium
27

You are troubleshooting a container networking issue. You notice that traffic from the container is not being SNATed. What should you check in the iptables rules?

Hard
28

Which command is used to remove an unused Docker image?

Easy
29

Which TWO of the following are valid container orchestration platforms?

Medium
30

Which TWO commands are used to manage images in Docker?

Medium
31

Which THREE storage drivers are supported by Docker?

Hard
32

What is the main advantage of using a container over a virtual machine?

Easy
33

You need to inspect the metadata of a specific Docker image without pulling it from a remote registry. Which command should you use?

Medium
34

You are debugging a Docker image buildup that fails at the 'RUN' instruction due to missing network access during the build. What command option should be checked if the build environment uses a proxy?

Medium
35

You are using BSD Jails and need to start a jail. Which utility is the standard management tool for jail administration?

Medium
36

Which THREE items are typically included in an OpenVZ configuration file?

Hard
37

You are troubleshooting a Docker container that fails to start with the error 'no space left on device' even though `df -h` shows ample free space on the host's root filesystem. The Docker data root is on a separate partition. Which command should you use to check the actual disk usage of Docker's data root?

Hard
38

An administrator needs to run a container that requires access to a specific block device on the host, such as /dev/sdb, for direct I/O operations. Which Docker run option should be used to grant the container access to this device?

Hard
39

In a Docker swarm, which mode of service publishing allows incoming traffic to be load-balanced across all healthy container replicas?

Hard
40

Which command lists all Docker images currently on the host?

Easy
41

When cleaning up Docker resources, which command will remove all stopped containers, unused networks, and dangling images in one step?

Hard
42

Which Docker command is used to display the resource usage (CPU, memory) of running containers?

Easy
43

Which THREE configuration items can be managed by LXC cgroups?

Hard
44

You are building a Docker image and want to ensure that a build-time variable is available only during the build, not persisted in the final image's environment. Which instruction should you use?

Hard
45

You are optimizing a Dockerfile to reduce image size. Which THREE of the following practices are recommended?

Hard
46

A developer wants to run a short-lived container that executes a command and then removes itself automatically after exit. Which `docker run` flag should be used?

Easy
47

In the context of container orchestration, what is the role of a 'sidecar' container?

Medium
48

You are debugging a Docker network issue where containers on different hosts cannot communicate. Which network driver is specifically designed to support multi-host overlay networking?

Hard
49

Which command-line tool is primarily used to inspect the metadata and configuration of a running Docker container?

Easy
50

Which THREE of the following are components of the Docker architecture?

Medium
51

Which command allows you to enter an existing running container and execute a new command inside it?

Medium
52

You are building a Docker image and need to ensure that the container process runs as a non-root user with UID 1000 and that this user exists in the image. Which pair of Dockerfile instructions achieves this correctly?

Hard
53

Which TWO types of namespaces are commonly used to achieve container isolation in Linux?

Medium
54

You are building a multi-stage Dockerfile and want to copy a binary from the 'builder' stage to the final stage. Which syntax is correct?

Hard
55

You are migrating a legacy application to an LXC container and need to ensure the container has access to the host's /dev/sda block device. Which configuration key must be added to the container's configuration file?

Medium
56

Which command-line option is used to run a Docker container in the background (detached mode)?

Easy
57

You are managing an LXC container and need to create a snapshot of the container's root file system. Which command achieves this?

Medium
58

In an OpenVZ environment, you need to limit the number of processes a container can create. Which parameter in the container configuration file should be modified?

Hard
59

In systemd-nspawn, how do you specify a different root directory for the container?

Hard
60

What is the primary difference between a container image and a container instance?

Easy
61

What is the primary function of the ENTRYPOINT instruction in a Dockerfile?

Easy
62

How do you view the logs of a running container?

Easy
63

Which instruction in a Dockerfile is best suited for installing packages to minimize image size?

Medium
64

Which TWO commands are valid for inspecting container network settings?

Medium
65

What is the purpose of the 'rkt' (Rocket) container runtime?

Medium
66

You are using Docker and need to inspect the metadata of a running container, including its IP address, environment variables, and mounted volumes. Which command provides all this information in a single JSON output?

Medium
67

Which command shows the history of layers in a Docker image?

Easy
68

You are running a Docker container that needs to persist data in a directory that is backed by a storage area on the host. The host uses the overlay2 storage driver. You want the container to write data that survives container removal and is accessible directly on the host filesystem. Which approach should you use?

Hard
69

You are using Docker and want to create a volume that is shared between multiple containers and persists even if the containers are deleted. What is the best approach?

Hard
70

A developer is building a container image and wants to reduce its final size by ensuring that no package manager cache files remain in the image layers. Which Dockerfile instruction should be used to remove these temporary files during the build?

Easy
71

You are using Docker and need to view the layers that make up an image to understand its build history. Which command should you use?

Easy
72

What is the role of the 'Dockerfile' in the container build process?

Medium
73

Which TWO of the following are valid storage drivers used by Docker to manage image layers?

Medium
74

You are running a Podman container as a non-root user with rootless mode. The container needs to bind to TCP port 80 inside the container's network namespace so a legacy application can listen for HTTP traffic. Which capability must be added to the container to allow binding to this privileged port without running the container as root?

Medium
75

You are troubleshooting a Docker container that cannot reach the internet despite the host having connectivity. The container uses the default bridge network. Which iptables chain is most likely causing the block?

Hard
76

Which command provides system-wide information about the Docker installation?

Easy
77

You need to run a container that requires access to the host's network namespace directly to perform packet capture. Which Docker run flag should you use?

Medium
78

Which flag is used to run a container in the background?

Easy
79

What is the purpose of the 'ENTRYPOINT' instruction in a Dockerfile?

Medium
80

You are configuring an OpenVZ container. Which command is used to set the hostname of the container from the host?

Hard
81

In a Docker environment, you are observing that container logs are consuming too much disk space. Which logging driver should you configure to limit the number and size of log files?

Hard
82

Which TWO of the following are true regarding container orchestration platforms?

Hard
83

You are building a Docker image for a Python web application. The Dockerfile currently contains: FROM python:3.9-slim COPY . /app WORKDIR /app RUN pip install -r requirements.txt CMD ["python", "app.py"] After building, you notice that every time you change app.py, the entire pip install step re-runs, making builds slow. Which change to the Dockerfile will best address this?

Medium
84

Which command is used to stop all running containers?

Easy

Frequently asked questions

What does the Container Virtualization domain cover on the 305-300 exam?
You must be able to choose and run the correct container management command for filesystem snapshots, network driver selection, alternate root directories, and local image inspection. The most important thing is matching the exact tool and option to the task, especially LXC versus Docker versus systemd-nspawn.
How many questions are in this domain?
This page lists all 84 Container Virtualization questions in the 305-300 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Container Virtualization questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
LPIC-3 Exam 305: Virtualization and Containerization (305-300) (305-300) Container Virtualization Practice Questions