Docker: Containerization Fundamentals
Docker: Containerization Fundamentals
Up to 20 questions, shuffled on every run
Welcome to the Docker Basics Quiz! This quiz covers fundamental Docker concepts, containerization, and best practices. Each question is multiple-choice, and you’ll find hints to help you along the way. Good luck!
Answer key and explanations20 questions
The quiz above draws 20 questions at random from these 30, so a second attempt will not be the same run. Everything in the pool is listed here.
Which Dockerfile instruction specifies the base image for a new container?
Answer`FROM`
Which command is used to build an image from a Dockerfile?
Answer`docker build`
What is the primary difference between CMD and ENTRYPOINT?
Answer`ENTRYPOINT` sets the executable; `CMD` sets default arguments
Which command displays the list of currently running containers?
Answer`docker ps`
What does the -d flag do when running a container?
AnswerStarts the container in detached background mode
Which instruction allows you to set environmental variables within a Dockerfile?
Answer`ENV`
What is a Docker "Layer"?
AnswerA read-only filesystem change from a command
How do you stop all running Docker containers at once?
Answer`docker stop $(docker ps -q)`
Which Docker network driver is the default for standalone containers?
Answer`Bridge`
What is the purpose of a Docker ".dockerignore" file?
AnswerExcludes local files from being sent to the build context
Which command allows you to enter a running container and start a shell?
Answer`docker exec -it <id> /bin/bash`
What is the command to delete a specific Docker image?
Answer`docker rmi`
What is a "Volume" in Docker?
AnswerA persistent storage area managed by Docker
In "docker run -p 8080:80 nginx", which port is the host port?
Answer8080
Which instruction defines the directory where subsequent commands will be executed?
Answer`WORKDIR`
What is "Multi-stage building"?
AnswerUsing separate stages to reduce final image size
Which command is used to see the metadata (IP, Config, etc.) of a container?
Answer`docker inspect`
What is the purpose of "Docker Hub"?
AnswerA public registry for sharing container images
What is "Copy-on-Write" (CoW)?
AnswerA strategy that copies files only when modified
Which command pulls an image from a registry without running it?
Answer`docker pull`
What does "docker system prune" do?
AnswerRemoves unused data like stopped containers
Which Dockerfile instruction is used to document intended ports?
Answer`EXPOSE`
What is a "Dangling Image"?
AnswerAn image that has no name tag or reference
Which command starts a previously stopped container?
Answer`docker start`
What is the default user in most Docker images if not specified?
Answer`root`
Which command logs you into a Docker registry?
Answer`docker login`
What is Docker Compose used for?
AnswerRunning multi-container apps using YAML files
Which flag is used to name a container during "docker run"?
Answer--name
What is the purpose of the "HEALTHCHECK" instruction?
AnswerTo check if the application inside is functional
What command shows the history of an image?
Answer`docker history`








