← Back to Quiz Home
Welcome! 🐳
Test your knowledge on Docker networking, volumes, and composition.
Instructions:
- Select the best answer for each question.
- Your score will be shown at the end.
Which command is used to show container logs?
docker logs fetches the logs of a container.
What is a Docker Volume used for?
Volumes are the preferred mechanism for persisting data generated by and used by Docker containers.
Which command is used to launch a multi-container application defined in a YAML file?
docker-compose up builds, (re)creates, starts, and attaches to containers for a service defined in a docker-compose.yml.
Which Docker network driver is the default for containers?
bridge is the default network driver. If you don't specify a driver, this is the type of network you are building.
How do you execute a command inside a running container?
docker exec runs a new command in a running container. -it allows interactive access.
Which command removes an image?
docker rmi (or docker image rm) removes one or more images.
What is the purpose of .dockerignore file?
It excludes files and directories from the build context, similar to .gitignore.
Which flag maps a port from the container to the host?
-p (e.g., -p 8080:80) maps a Host port to a Container port.
What is a dangling image?
Dangling images are untagged images, often intermediate layers from old builds, displayed as <none>.
Which command creates a new volume?
`docker volume create` manually creates a named volume.
Which command builds an image from a Dockerfile in the current directory?
docker build builds an image from a Dockerfile. The . specifies the build context (current directory).
What is the default name of the Docker configuration file that defines a multi-container application?
docker-compose.yml is the default file used by Docker Compose.
In Docker Compose, which keyword defines the dependencies between services?
depends_on expresses dependency order (start order).
Which network driver creates a distributed network among multiple Docker daemon hosts?
The overlay network driver creates a distributed network among multiple Docker daemon hosts.
How can you isolate a container from the host network stack?
Containers are isolated by default using the bridge driver.
What command lists all networks?
docker network ls lists all networks.
How do you inspect a specific network?
docker network inspect provides detailed information about a network.
Which command removes all unused networks?
docker network prune removes all networks not used by at least one container.
Bind mounts map a host file or directory to a container path.
Which instruction in Dockerfile is used to copy files from the context to the image?
COPY copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>.
Quiz Progress
0 / 0 questions answered
(0%)
0 correct
Quiz Complete!
0%
📚 Study Guides
📬 Weekly DevOps, Cloud & Gen AI quizzes & guides