Docker Compose MCQs with answers
57 questions tagged Docker Compose, each with the correct answer and an explanation. Page 1 of 3.
- What does the `hostname` key specify in docker-compose.yml?
- What is the default network name created by Docker Compose?
- Which key in docker-compose.yml can restrict services to run on specific nodes in a swarm?
- What is the purpose of `depends_on` in Docker Compose?
- Which key in docker-compose.yml maps host paths to container paths?
- What is the effect of `stdin_open: true` in docker-compose.yml?
- Which key allows specifying DNS settings in docker-compose.yml?
- What does the `logging` key configure in docker-compose.yml?
- Which Docker Compose command stops all services without removing them?
- How do you specify a custom name for a service container in docker-compose.yml?
- Which section defines how to attach to external networks in Compose?
- What does the `entrypoint` key in docker-compose.yml do?
- What is the default network driver in Docker Compose?
- What will `docker-compose down --volumes` do?
- What is the `profiles` key used for in docker-compose.yml?
- Which command updates running services after changes in the docker-compose.yml?
- Which key in docker-compose.yml sets memory limits for services?
- Which command shows the configuration in a resolved format from docker-compose.yml?
- What does the `scale` option in Docker Compose allow you to do?
- Which section allows for defining constraints on service deployment in Swarm mode?