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.
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.
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?
Medium2Which TWO of the following are true regarding the differences between rkt (Rocket) and Docker?
Hard3In a FreeBSD Jail, how can you ensure the jail starts automatically at boot?
Hard4A 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?
Medium5Which 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?
Medium6When building a Dockerfile, which instruction should be used to define the user context for subsequent RUN, CMD, and ENTRYPOINT instructions?
Easy7When configuring a systemd-nspawn container, what is the effect of the --private-network option?
Hard8A 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?
Medium9You 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?
Medium10Which Dockerfile instruction is used to copy a file from the host file system into the image?
Medium11Which THREE instructions in a Dockerfile can modify the image's filesystem?
Medium12You 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?
Medium13You 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?
Medium14Which THREE networking modes are natively supported by Docker?
Hard15You 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?
Easy16Which THREE features are provided by Linux Namespaces in the context of containers?
Hard17What does the 'docker rm' command do?
Easy18A 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?
Medium19Which file is primarily responsible for defining the configuration and environment variables for an OpenVZ container?
Medium20You are using systemd-nspawn. How do you create an image of a container to be used as a template?
Hard21What is the primary function of a Docker Registry?
Medium22You 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.)
Hard23You 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?
Hard24You 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.)
Medium25When using 'docker-compose', which file format is used to define the services?
Medium26When 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?
Medium27You 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?
Hard28Which command is used to remove an unused Docker image?
Easy29Which TWO of the following are valid container orchestration platforms?
Medium30Which TWO commands are used to manage images in Docker?
Medium31Which THREE storage drivers are supported by Docker?
Hard32What is the main advantage of using a container over a virtual machine?
Easy33You need to inspect the metadata of a specific Docker image without pulling it from a remote registry. Which command should you use?
Medium34You 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?
Medium35You are using BSD Jails and need to start a jail. Which utility is the standard management tool for jail administration?
Medium36Which THREE items are typically included in an OpenVZ configuration file?
Hard37You 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?
Hard38An 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?
Hard39In a Docker swarm, which mode of service publishing allows incoming traffic to be load-balanced across all healthy container replicas?
Hard40Which command lists all Docker images currently on the host?
Easy41When cleaning up Docker resources, which command will remove all stopped containers, unused networks, and dangling images in one step?
Hard42Which Docker command is used to display the resource usage (CPU, memory) of running containers?
Easy43Which THREE configuration items can be managed by LXC cgroups?
Hard44You 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?
Hard45You are optimizing a Dockerfile to reduce image size. Which THREE of the following practices are recommended?
Hard46A 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?
Easy47In the context of container orchestration, what is the role of a 'sidecar' container?
Medium48You 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?
Hard49Which command-line tool is primarily used to inspect the metadata and configuration of a running Docker container?
Easy50Which THREE of the following are components of the Docker architecture?
Medium51Which command allows you to enter an existing running container and execute a new command inside it?
Medium52You 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?
Hard53Which TWO types of namespaces are commonly used to achieve container isolation in Linux?
Medium54You are building a multi-stage Dockerfile and want to copy a binary from the 'builder' stage to the final stage. Which syntax is correct?
Hard55You 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?
Medium56Which command-line option is used to run a Docker container in the background (detached mode)?
Easy57You are managing an LXC container and need to create a snapshot of the container's root file system. Which command achieves this?
Medium58In 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?
Hard59In systemd-nspawn, how do you specify a different root directory for the container?
Hard60What is the primary difference between a container image and a container instance?
Easy61What is the primary function of the ENTRYPOINT instruction in a Dockerfile?
Easy62How do you view the logs of a running container?
Easy63Which instruction in a Dockerfile is best suited for installing packages to minimize image size?
Medium64Which TWO commands are valid for inspecting container network settings?
Medium65What is the purpose of the 'rkt' (Rocket) container runtime?
Medium66You 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?
Medium67Which command shows the history of layers in a Docker image?
Easy68You 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?
Hard69You 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?
Hard70A 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?
Easy71You are using Docker and need to view the layers that make up an image to understand its build history. Which command should you use?
Easy72What is the role of the 'Dockerfile' in the container build process?
Medium73Which TWO of the following are valid storage drivers used by Docker to manage image layers?
Medium74You 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?
Medium75You 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?
Hard76Which command provides system-wide information about the Docker installation?
Easy77You 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?
Medium78Which flag is used to run a container in the background?
Easy79What is the purpose of the 'ENTRYPOINT' instruction in a Dockerfile?
Medium80You are configuring an OpenVZ container. Which command is used to set the hostname of the container from the host?
Hard81In 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?
Hard82Which TWO of the following are true regarding container orchestration platforms?
Hard83You 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?
Medium84Which command is used to stop all running containers?
EasyOther domains
All 305-300 exam domains
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.