Explanation: The 'docker-compose down' command stops and removes all containers defined in the compose file.
Dear candidates you will find MCQ questions of Docker here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Explanation: The 'docker-compose down' command stops and removes all containers defined in the compose file.
Explanation: Environment variables can be defined using an '.env' file or within the 'environment' section in the compose file.
Explanation: The 'docker-compose logs' command displays logs for a specific service.
Explanation: The 'docker-compose up --scale' command is used to scale services.
Explanation: The 'depends_on' option specifies service dependencies in a Docker Compose file.
Explanation: Using the '--build' flag with 'docker-compose up' rebuilds the images before starting the services.
Explanation: The 'docker-compose restart' command restarts all running services.
Explanation: The 'docker volume prune' command removes unused Docker volumes.
Explanation: The 'build' section in a Docker Compose file specifies how a service should be built from a Dockerfile.
Explanation: Docker Compose supports restart policies such as 'always', 'on-failure', and 'unless-stopped'.