Unlock hundreds more features
Save your Quiz to the Dashboard
View and Export Results
Use AI to Create Quizzes and Analyse Results

Sign inSign in with Facebook
Sign inSign in with Google

Take the Docker Quiz: How Well Do You Know Containers?

Ready for a Docker container quiz? Test your fundamentals now!

Difficulty: Moderate
2-5mins
Learning OutcomesCheat Sheet
Paper art illustration of Docker container puzzle pieces quiz icons on dark blue background

Gear up for our Docker Quiz: Free Container Knowledge Challenge and put your container skills to the test! Whether you're brushing up on Docker fundamentals or seeking hands-on practice, this Docker container quiz covers core commands, essential Docker deployment best practices, and platform insights to prepare you for real-world builds and cloud environments. Curious about orchestration or broader cloud concepts? Explore our kubernetes quiz and dive into our cloud computing quiz for extra prep. Start your Docker fundamentals test now - measure your mastery today!

What is Docker?
A continuous integration and delivery tool
A monitoring tool for infrastructure
A virtualization hypervisor for running VMs
A containerization platform for packaging applications
Docker is an open-source containerization platform that enables developers to package applications and their dependencies into portable containers. It leverages OS-level virtualization to run multiple isolated containers on the same host. Containers share the host OS kernel but maintain their own isolated filesystem, network, and process space. Learn more.
Which command lists all currently running containers?
docker list
docker run
docker ls
docker ps
The `docker ps` command displays all running containers, including their container ID, image, status, ports, and names. To see even stopped containers you can add the `-a` option. This is fundamental for monitoring which containers are currently active on a host. See documentation.
How do you build a Docker image from a Dockerfile?
docker compose build
docker make -t
docker build -t
docker init
The `docker build -t` command builds an image from a Dockerfile in the current directory and tags it with the specified name. The `-t` option allows you to set the image name and optional tag. This command reads the Dockerfile and creates a layered image according to its instructions. More details.
What is the default filename Docker looks for when building an image?
Dockerfile
compose.yml
dockerfile
docker-compose.yaml
By default, Docker looks for a file named `Dockerfile` (case-sensitive) in the build context directory. You can override this by using the `-f` option with `docker build`. The Dockerfile defines the build steps for creating your image. Learn about Dockerfile.
What is a Docker image?
A running instance of a container
A read-only template used to create containers
A network configuration
The Docker daemon process
A Docker image is a read-only template that contains instructions for creating a container. Images are composed of layers and can be shared via registries. When you run an image, a writable container layer is added on top of the image. Docker Glossary.
Which command removes dangling images?
docker clean images
docker rm images
docker image prune
docker rmi -a
The `docker image prune` command removes all dangling images - those not tagged and not referenced by any container. This helps to reclaim disk space. You can add the `-a` option to remove unused images as well. Reference.
How do you run a container in interactive mode with a terminal?
docker run -it
docker exec -it
docker run -d
docker start -i
Using `docker run -it` launches a new container in interactive mode (`-i`) with a pseudo-TTY (`-t`). This allows you to attach to the container's shell or other interactive processes. It's commonly used for debugging or running shells inside containers. Details.
Which option maps a host port to a container port on docker run?
-p
-v
--link
--expose
The `-p host_port:container_port` (or `--publish`) flag maps a port on the Docker host to a port in the container. This is necessary to make containerized services accessible from outside the container's network namespace. See more.
How do you view the logs of a running container?
docker inspect
docker logs
docker events
docker top
The `docker logs` command fetches the logs of a container's STDOUT and STDERR streams. It supports options like `--follow` to stream logs in real time and `--tail` to show only the last N lines. Official docs.
What is the difference between CMD and ENTRYPOINT in a Dockerfile?
CMD defines default arguments for ENTRYPOINT, ENTRYPOINT sets the executable
They are identical in function but different syntax
ENTRYPOINT can be overridden at runtime, CMD cannot
CMD runs before ENTRYPOINT in the build process
In Dockerfile syntax, `ENTRYPOINT` configures a container to run as an executable, while `CMD` provides default arguments to the ENTRYPOINT. CMD can be overridden when starting the container, but ENTRYPOINT usually remains fixed unless you use `--entrypoint`. Read more.
Which option uses the modern syntax to bind-mount a host directory into a container?
--mount
--bind
-v
--link
The `--mount` flag is the newer, more explicit syntax for mounting volumes or bind mounts inside containers. It supports multiple options such as `type=bind`, `source`, and `target`. The older `-v` shorthand is still supported but less descriptive. Details.
Which command shows low-level details about a container, like configuration and network settings?
docker stats
docker info
docker logs
docker inspect
The `docker inspect` command returns detailed JSON output about container or image configuration, state, network settings, mounts, and more. It's essential for debugging and automation scripts. Read docs.
What is the default network driver Docker uses for containers?
host
overlay
bridge
none
By default, Docker uses the `bridge` network driver, creating an isolated network on the host for containers. Containers on the same bridge network can communicate via IP or linked ports. Other drivers like host, none, and overlay serve specialized use cases. Learn about bridge networks.
How do you push a local image to a Docker registry?
docker upload
docker commit
docker push
docker publish
The `docker push` command uploads a tagged image from your local host to a configured registry. It pushes all referenced layers and image metadata. Ensure you're logged in and have correctly tagged the image with the registry endpoint. More info.
What technique allows you to reduce the size of a Docker image by using multiple build stages?
Running garbage collection after each RUN
Combining all RUN instructions into one
Using docker-squash tool explicitly
Using multiple FROM statements and copying only artifacts needed
Multi-stage builds use multiple `FROM` statements in a single Dockerfile. You compile or build artifacts in intermediate stages, then copy only the necessary outputs into the final stage. This dramatically reduces the final image size by omitting build dependencies. Official guide.
How can you limit a container's memory usage?
--limit-cpu
--memory
--cpus
--memory-limit
The `--memory` flag sets the maximum amount of memory the container can use. You specify values like `--memory=512m` or `--memory=1g`. Docker enforces this limit using cgroups. Resource constraints reference.
What is Docker Content Trust used for?
Restricting IP-based registry access
Scanning for vulnerabilities
Encrypting images at rest
Signing and verifying images with Notary
Docker Content Trust uses The Update Framework (TUF) and Notary to sign and verify the publisher of images. It ensures that the images you pull are trusted and unaltered. Enable it by setting `DOCKER_CONTENT_TRUST=1`. Learn more.
Which flag removes a container along with its associated anonymous volumes?
docker container prune --all
docker rm -a
docker rm -v
docker rmi --volumes
The `-v` flag on `docker rm` removes any anonymous volumes associated with the container. Without `-v`, volumes remain on the host. Named volumes are not removed unless you explicitly remove them. Command reference.
How do you roll back a failed update of a Docker Swarm service?
docker service revert
docker stack rollback
docker service rollback
docker service update --rollback
In Docker Swarm mode, you can roll back a service update by running `docker service update --rollback SERVICE`. This reverts the service to the previous version of its image and configuration. It's useful for recovering from a bad deployment. Read more.
What is the primary purpose of the overlay network driver?
Link containers on the same host only
Share volumes between containers
Enable container communication across multiple Docker hosts
Connect the Docker daemon to the internet
The overlay network driver allows containers running on different Docker hosts to communicate securely, provided they share the same Swarm or utilize an external key-value store. It encapsulates container traffic in VXLAN tunneling. This is essential for multi-host deployments. Overlay networks.
How do you enable BuildKit when building images with Docker?
enable_buildkit: true
--buildkit
DOCKER_BUILDKIT=1 docker build
docker build --kit
To enable BuildKit you set the environment variable `DOCKER_BUILDKIT=1` before running `docker build`. BuildKit offers improved performance, caching, and advanced features like concurrent builds. BuildKit docs.
What is the difference between 'docker commit' and 'docker build'?
docker commit builds from Dockerfile, docker build saves a container state
docker build requires a running container, docker commit does not
docker commit creates an image from a container's current state, docker build uses instructions in a Dockerfile
They are synonyms and function identically
`docker commit` snapshots the state of an existing container into a new image layer, whereas `docker build` constructs an image from instructions in a Dockerfile. Build processes are reproducible and version-controlled, while commit creates an image ad-hoc. More info.
What does OCI stand for in the context of containers?
Official Container Initiative
Open Code Integration
Oracle Container Implementation
Open Container Initiative
OCI stands for the Open Container Initiative, a Linux Foundation project that defines industry standards around container image and runtime specifications. OCI ensures interoperability between different container tools. The spec covers image format and runtime behavior. Project site.
How do you run Docker in rootless mode?
Use the --rootless flag with docker run
Set DOCKER_ROOTLESS=true when building images
Docker does not support rootless operation
Execute the dockerd-rootless.sh script to start a rootless daemon
Rootless Docker allows the daemon and containers to run without root privileges by using user namespaces and a helper script `dockerd-rootless.sh`. This enhances security by isolating the Docker daemon from host root. Rootless mode guide.
Which command scans a Docker image for known vulnerabilities?
docker test
docker audit
docker vulnerability
docker scan
The `docker scan` command integrates with Snyk to detect known vulnerabilities in image layers. It analyzes package metadata and reports issues, severity, and potential fixes. You must have Docker Scan enabled and be logged in. Scan documentation.
0
{"name":"What is Docker?", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What is Docker?, Which command lists all currently running containers?, How do you build a Docker image from a Dockerfile?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}

Study Outcomes

  1. Understand Docker Fundamentals -

    Grasp core container concepts such as images, layers, and the Docker daemon to build a solid foundation in containerization.

  2. Demonstrate Docker CLI Proficiency -

    Execute essential Docker commands like docker build, run, stop, and rm to manage container lifecycles with confidence.

  3. Apply Best Practices for Container Deployment -

    Implement strategies for data persistence, environment configuration, and efficient image creation in real-world deployments.

  4. Analyze Troubleshooting Scenarios -

    Diagnose common container errors and performance issues by interpreting logs and refining Docker settings.

  5. Evaluate Security and Optimization Techniques -

    Assess methods for securing images, setting resource limits, and optimizing container performance.

  6. Prepare for Docker Certification -

    Identify knowledge gaps and reinforce key topics through targeted quiz questions aligned with certification objectives.

Cheat Sheet

  1. Understanding Docker Architecture -

    Based on Docker's official documentation and Linux Foundation training, grasp how the Docker daemon, client, images, and containers interact to deliver lightweight virtualization. Use the mnemonic "ICDC" (Image → Container → Daemon → Client) to recall core components when tackling your Docker fundamentals test. Recognizing this flow is key for any Docker Quiz scenario involving troubleshooting or design.

  2. Core Docker Commands -

    Familiarize yourself with essential commands like docker run, pull, build, and commit - critical for success in a Docker container quiz or Docker certification practice. Remember "RPBC" (Run, Pull, Build, Commit) as a quick recall trick, and practice examples such as docker run -d -p 80:80 nginx. Mastery of these commands underpins most real-world scenarios and exam questions.

  3. Container Networking Modes -

    Learn bridge, host, and overlay networks from Docker's networking guide to ensure you can architect multi-container applications effectively - an important segment of any Docker Quiz. Try docker network create -d overlay mynet to see overlay mode in action, and recall "BHOB" (Bridge, Host, Overlay, None) when selecting the right driver. Strong networking knowledge boosts confidence for deployment challenges.

  4. Dockerfile Best Practices -

    Study layer caching, minimal base images, and multi-stage builds recommended by the official Docker Blog to optimize image size and build speed. Use a simple rule: "Order Matters," placing frequently changing steps last to leverage cache. For instance, a two-stage build starts FROM golang AS builder, then FROM alpine AS final to deliver lean production images.

  5. Orchestration & Deployment Best Practices -

    Review Docker Compose and Swarm fundamentals from Docker's deployment best practices guide to coordinate services, scale containers, and manage configs - skills often tested in a Docker fundamentals test. Employ docker-compose.yml for local stacks and swarm init followed by docker stack deploy for scalable clusters, remembering "Compose Locally, Swarm at Scale." This dual approach readies you for real-world DevOps workflows.

Powered by: Quiz Maker