Docker Compose simplifies the management of multi-container applications by allowing you to define and run containers using a single YAML configuration file. It is an essential tool for developers and DevOps engineers working on microservices or containerized environments.
Mastering Docker Compose is crucial for technical interviews, as it demonstrates your ability to manage multi-container setups effectively. These top MCQs cover the foundational and advanced aspects of Docker Compose, ensuring you are well-prepared for interviews and real-world scenarios.
1.) What is Docker Compose used for?
2.) What is the default filename for Docker Compose configuration?
3.) Which command is used to start all services defined in a docker-compose.yml file?
4.) How do you stop all running services managed by Docker Compose?
5.) Which command removes containers, networks, and volumes created by Docker Compose?
6.) What is the purpose of the volumes key in a docker-compose.yml file?
7.) Which flag is used with docker-compose up to recreate containers even if they already exist?
8.) How do you execute a command inside a running container managed by Docker Compose?
9.) Which command lists all services defined in a Docker Compose file?
10.) What is the default network driver used by Docker Compose?