Docker Basics Quiz: Test Your Container Knowledge.

Docker Basics Quiz: Test Your Container Knowledge.

1. What is Docker primarily used for?

A) Virtualization of hardware
B) Containerization of applications
C) Creating databases
D) Network monitoring
Answer: B

2. Which command lists all running Docker containers?

A) docker ps
B) docker list
C) docker containers
D) docker images
Answer: A

3. Which file defines how a Docker image is built?

A) docker-compose.yml
B) Dockerfile
C) docker.env
D) Docker.json
Answer: B

4. Which command stops a running container?

A) docker end <container>
B) docker stop <container>
C) docker terminate <container>
D) docker killall
Answer: B

5. How do you remove a container?

A) docker delete <container>
B) docker rm <container>
C) docker remove <container>
D) docker stop <container>
Answer: B

6. How do you list all Docker images?

A) docker images
B) docker show images
C) docker ls images
D) docker list
Answer: A

7. What does a Docker Volume do?

A) Stores logs only
B) Persistent data storage
C) Controls container CPU
D) Manages network
Answer: B

8. Command to build an image from a Dockerfile?

A) docker run -t <name>
B) docker build -t <name> .
C) docker create <name>
D) docker start <name>
Answer: B

9. Command to pull an image from Docker Hub?

A) docker fetch <image>
B) docker download <image>
C) docker pull <image>
D) docker get <image>
Answer: C

10. Which command runs a container in the background?

A) docker run -d <image>
B) docker run -i <image>
C) docker run -t <image>
D) docker run -a <image>
Answer: A

11. What is the default network type in Docker?

A) Host
B) Bridge
C) Overlay
D) NAT
Answer: B

12. Which command shows detailed info about a container?

A) docker info <container>
B) docker inspect <container>
C) docker logs <container>
D) docker details <container>
Answer: B

13. How do you rename a Docker container?

A) docker rename <old> <new>
B) docker mv <old> <new>
C) docker tag <old> <new>
D) docker change <old> <new>
Answer: A

14. Which command removes all stopped containers?

A) docker rm $(docker ps -a -q)
B) docker clean containers
C) docker prune containers
D) docker delete all
Answer: A

15. Which command lists Docker networks?

A) docker network list
B) docker net ls
C) docker network show
D) docker list networks
Answer: A

16. What is Docker Hub?

A) Local image repository
B) Cloud-based image registry
C) Docker monitoring tool
D) Docker logging service
Answer: B

17. Which command removes an image?

A) docker remove <image>
B) docker rmi <image>
C) docker delete <image>
D) docker rm <image>
Answer: B

18. Which flag shows all containers, including stopped ones?

A) docker ps -a
B) docker ps -s
C) docker ps -all
D) docker ps -l
Answer: A

19. Which of these is NOT a Docker component?

A) Docker Engine
B) Docker CLI
C) Docker Hub
D) Docker VM
Answer: D

20. What does docker exec do?

A) Executes a command in a running container
B) Starts a container
C) Builds a container image
D) Stops a container
Answer: A

21. What is a Docker image?

A) A running container
B) A template to create containers
C) A network configuration
D) A persistent volume
Answer: B

22. What is a Docker container?

A) A lightweight, isolated environment from an image
B) A virtual machine
C) A Docker CLI command
D) A network bridge
Answer: A

23. Which command shows logs of a container?

A) docker view <container>
B) docker log <container>
C) docker logs <container>
D) docker inspect <container>
Answer: C

24. Which command runs a container interactively?

A) docker run -i -t <image>
B) docker run -d <image>
C) docker start -i <image>
D) docker exec -d <image>
Answer: A

25. Command to tag an image before pushing?

A) docker rename <image>
B) docker tag <image> <repo>:<tag>
C) docker label <image>
D) docker push <image>
Answer: B

Congratulations!

You’ve completed the Docker Basics Quiz. Whether you got all answers right or found a few tricky questions, this quiz is a great way to reinforce your understanding of Docker concepts from containers, images, and volumes to networking and Docker CLI commands.

Docker is a powerful tool in modern software development, enabling developers to build, ship, and run applications consistently across environments. Regular practice and hands-on experimentation are the keys to mastering it.

Here are a few next steps to level up your Docker skills:

  1. Practice with Docker commands: Spin up containers, create images, and try different CLI options.
  2. Explore Docker Compose: Learn how to orchestrate multi-container applications.
  3. Understand volumes and networking: Experiment with persistent storage and container communication.
  4. Try a mini project: Containerize a small app, like a web server or database, to apply what you’ve learned.
  5. Prepare for advanced topics: Kubernetes, Docker Swarm, and container security.

Remember, quizzes are not just about testing knowledge they’re about learning actively. The more you practice, the more confident you’ll become in managing containers and using Docker effectively.

Keep exploring, keep experimenting, and enjoy your journey in the world of containers!

For more information about Docker, you can refer to Jeevi’s page.

This tutorial is just the beginning learn Docker hands-on in our complete course. Upgrade your skills.

shamitha
shamitha
Leave Comment
Share This Blog
Recent Posts
Get The Latest Updates

Subscribe To Our Newsletter

No spam, notifications only about our New Course updates.

Enroll Now
Enroll Now
Enquire Now