Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing to docker-practice

👋 Thank you for considering contributing to **docker-practice**!
This project is a community-driven, unofficial repository designed to help people prepare for the **Docker Certified Associate (DCA)** certification exam.
This project is a community-driven, unofficial repository designed to help people training on docker.

---

Expand All @@ -17,7 +17,7 @@ This project is a community-driven, unofficial repository designed to help peopl

We welcome contributions such as:

- ✅ New YAML quiz files for DCA topics
- ✅ New YAML quiz files
- ✅ Improvements to existing questions (clarity, accuracy, formatting)
- ✅ Helpful links to official documentation (Docker or Mirantis)
- ✅ Typos or syntax corrections
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Docker Practice – Unofficial DCA Certification Prep
# Docker Practice - Comprehension training

> ⚠️ **Disclaimer**: This project is **independent and unofficial**. It is **not affiliated**, **endorsed**, or **approved** by Docker Inc., Mirantis, or any of their affiliates.
> All quiz questions and content are **community-made** for educational and personal preparation purposes only.

## 📘 About this project

This repository offers a comprehensive collection of YAML-based quiz questions to help you prepare for the **Docker Certified Associate (DCA)** exam — based on the **Mirantis DCA Study Guide (2025)**.
This repository offers a comprehensive collection of YAML-based quiz questions to help to train based on the **Mirantis DCA Study Guide (2025)**.

The goal is to help candidates:
- Test their knowledge of Docker engine, networking, security, orchestration, image management, and more.
Expand All @@ -17,7 +17,7 @@ The goal is to help candidates:
- ✅ **YAML-formatted questions** with:
- `uuid`, `question`, `answers`, `correct` flag
- `help` field pointing to the official documentation when applicable
- 🗂️ Organized by DCA topics:
- 🗂️ Organized by topics:
- Installation, Configuration, Security, Orchestration, Images, Registry, Volumes, Networking, etc.
- 🧠 Focused on **learning**, **not memorization**

Expand Down
80 changes: 40 additions & 40 deletions data/1_Orchestration/add_networks_publish_ports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,89 @@ questions:
- uuid: d55eac70-b350-4372-b5f2-9de85c09cadd
question: What is the default network driver used by Docker?
answers:
- { value: "macvlan", correct: false }
- { value: "host", correct: false }
- { value: "bridge", correct: true }
- { value: "overlay", correct: false }
- { value: 'macvlan', correct: false }
- { value: 'host', correct: false }
- { value: 'bridge', correct: true }
- { value: 'overlay', correct: false }
help: https://docs.docker.com/network/

- uuid: 1819e7eb-5d38-49f8-a6cb-abc5c7e6d5b1
question: Which flag is used to publish a port from a container to the host?
answers:
- { value: "--network", correct: false }
- { value: "--expose", correct: false }
- { value: "--dns", correct: false }
- { value: "-p", correct: true }
- { value: '--network', correct: false }
- { value: '--expose', correct: false }
- { value: '--dns', correct: false }
- { value: '-p', correct: true }
help: https://docs.docker.com/network/

- uuid: 3b7f5025-6b0f-4d3e-b91d-7fa84d392a4e
question: What does the command `docker run -p 8080:80 nginx` do?
answers:
- { value: "It publishes all container ports to the host", correct: false }
- { value: "It maps port 80 on the host to port 8080 in the container", correct: false }
- { value: "It exposes port 80 in the container only", correct: false }
- { value: "It maps port 8080 on the host to port 80 in the container", correct: true }
- { value: 'It publishes all container ports to the host', correct: false }
- { value: 'It maps port 80 on the host to port 8080 in the container', correct: false }
- { value: 'It exposes port 80 in the container only', correct: false }
- { value: 'It maps port 8080 on the host to port 80 in the container', correct: true }
help: https://docs.docker.com/network/

- uuid: a6c9a839-cf4a-4de6-a24d-b4e0b40c76c3
question: What is a user-defined bridge network useful for?
answers:
- { value: "Publishing ports to the internet", correct: false }
- { value: "Allowing containers to communicate by name", correct: true }
- { value: "Configuring IPv6 for containers", correct: false }
- { value: "Enabling external DNS resolution", correct: false }
- { value: 'Publishing ports to the internet', correct: false }
- { value: 'Allowing containers to communicate by name', correct: true }
- { value: 'Configuring IPv6 for containers', correct: false }
- { value: 'Enabling external DNS resolution', correct: false }
help: https://docs.docker.com/network/

- uuid: b7d01f2b-4dfb-4b7e-b0cf-0f73e2c2d884
question: What happens if you use the `none` network driver?
answers:
- { value: "The container has full internet access", correct: false }
- { value: "The container shares network with another container", correct: false }
- { value: "The container has no network access", correct: true }
- { value: "The container uses host networking", correct: false }
- { value: 'The container has full internet access', correct: false }
- { value: 'The container shares network with another container', correct: false }
- { value: 'The container has no network access', correct: true }
- { value: 'The container uses host networking', correct: false }
help: https://docs.docker.com/network/

- uuid: 4e1a16e1-cb62-4a4c-8c8b-4a1b4a707eb8
question: Which driver allows containers on different hosts to communicate in a Swarm?
answers:
- { value: "bridge", correct: false }
- { value: "overlay", correct: true }
- { value: "host", correct: false }
- { value: "ipvlan", correct: false }
- { value: 'bridge', correct: false }
- { value: 'overlay', correct: true }
- { value: 'host', correct: false }
- { value: 'ipvlan', correct: false }
help: https://docs.docker.com/network/

- uuid: 1bdb9159-f16a-4cf7-bcb9-b6aa64c4562d
question: How can you make a port published to the host only accessible from localhost?
answers:
- { value: "Use -p 127.0.0.1:8080:80", correct: true }
- { value: "Use -p 0.0.0.0:8080:80", correct: false }
- { value: "Use --network host", correct: false }
- { value: "Use --expose 80", correct: false }
- { value: 'Use -p 127.0.0.1:8080:80', correct: true }
- { value: 'Use -p 0.0.0.0:8080:80', correct: false }
- { value: 'Use --network host', correct: false }
- { value: 'Use --expose 80', correct: false }
help: https://docs.docker.com/network/

- uuid: d2f5124d-d5e3-4043-8ee1-f29e8c0dc553
question: Which network mode removes isolation between container and host?
answers:
- { value: "host", correct: true }
- { value: "overlay", correct: false }
- { value: "none", correct: false }
- { value: "bridge", correct: false }
- { value: 'host', correct: true }
- { value: 'overlay', correct: false }
- { value: 'none', correct: false }
- { value: 'bridge', correct: false }
help: https://docs.docker.com/network/

- uuid: 44d54f24-b71c-4214-87fd-402e3a128db1
question: How do you connect a running container to a new network?
answers:
- { value: "docker run --connect", correct: false }
- { value: "docker network connect", correct: true }
- { value: "docker connect", correct: false }
- { value: "docker attach --network", correct: false }
- { value: 'docker run --connect', correct: false }
- { value: 'docker network connect', correct: true }
- { value: 'docker connect', correct: false }
- { value: 'docker attach --network', correct: false }
help: https://docs.docker.com/network/

- uuid: a3d1e117-9e71-4c55-b1bc-f26bc03e7b1f
question: Which flag assigns a specific IP address to a container on a network?
answers:
- { value: "--ip", correct: true }
- { value: "--hostname", correct: false }
- { value: "--address", correct: false }
- { value: "--dns-ip", correct: false }
- { value: '--ip', correct: true }
- { value: '--hostname', correct: false }
- { value: '--address', correct: false }
- { value: '--dns-ip', correct: false }
help: https://docs.docker.com/network/
102 changes: 51 additions & 51 deletions data/1_Orchestration/apply_node_labels_placement_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,115 +2,115 @@ questions:
- uuid: 6cc6a97c-52dc-40c7-9cd3-7ef57709a38c
question: What command adds a label to a Docker Swarm node?
answers:
- { value: "docker service create --label", correct: false }
- { value: "docker node update --label-add", correct: true }
- { value: "docker swarm label add", correct: false }
- { value: "docker label node", correct: false }
- { value: 'docker service create --label', correct: false }
- { value: 'docker node update --label-add', correct: true }
- { value: 'docker swarm label add', correct: false }
- { value: 'docker label node', correct: false }
help: https://docs.docker.com/reference/cli/docker/node/update/

- uuid: b0633cfc-51d0-4b00-a97f-0882b2689f08
question: How can you inspect the labels of a node?
answers:
- { value: "docker node list --labels", correct: false }
- { value: "docker inspect --labels", correct: false }
- { value: "docker node inspect <node> --pretty", correct: true }
- { value: "docker node info", correct: false }
- { value: 'docker node list --labels', correct: false }
- { value: 'docker inspect --labels', correct: false }
- { value: 'docker node inspect <node> --pretty', correct: true }
- { value: 'docker node info', correct: false }
help: https://docs.docker.com/reference/cli/docker/node/inspect/

- uuid: a372b99d-0e1e-4e58-80ed-818e948c0e30
question: What placement constraint ensures a service runs only on nodes with a specific label?
answers:
- { value: "--require-label key=value", correct: false }
- { value: "--constraint 'node.labels.key == value'", correct: true }
- { value: "--affinity key=value", correct: false }
- { value: "--label 'key=value'", correct: false }
- { value: '--require-label key=value', correct: false }
- { value: '--constraint node.labels.key == value', correct: true }
- { value: '--affinity key=value', correct: false }
- { value: '--label key=value', correct: false }
help: https://docs.docker.com/engine/swarm/services/#placement-constraints

- uuid: e187c71b-dbf3-4488-b1d5-009d5ff3a383
question: What is the purpose of node labels in a Swarm cluster?
answers:
- { value: "To enforce security policies", correct: false }
- { value: "To prioritize CPU resource allocation", correct: false }
- { value: "To identify the container logs per node", correct: false }
- { value: "To control where services are deployed using constraints", correct: true }
- { value: 'To enforce security policies', correct: false }
- { value: 'To prioritize CPU resource allocation', correct: false }
- { value: 'To identify the container logs per node', correct: false }
- { value: 'To control where services are deployed using constraints', correct: true }
help: https://docs.docker.com/engine/swarm/services/#placement-constraints

- uuid: c8db2350-5126-43f4-bf6b-dfddf71a3c15
question: What happens if no node satisfies the placement constraint?
answers:
- { value: "The service is deployed on all nodes", correct: false }
- { value: "The service is not deployed", correct: true }
- { value: "The service is ignored", correct: false }
- { value: "Docker overrides the constraint", correct: false }
- { value: 'The service is deployed on all nodes', correct: false }
- { value: 'The service is not deployed', correct: true }
- { value: 'The service is ignored', correct: false }
- { value: 'Docker overrides the constraint', correct: false }
help: https://docs.docker.com/engine/swarm/services/#placement-constraints

- uuid: 63a88ed9-7ba3-4a9d-b0ae-76e54e6fa8a0
question: How do you deploy a service to nodes labeled `env=production`?
answers:
- { value: "docker node create --label 'env=production'", correct: false }
- { value: "docker service create --constraint 'node.labels.env == production'", correct: true }
- { value: "docker service create --label 'env=production'", correct: false }
- { value: "docker run --env production", correct: false }
- { value: 'docker node create --label env=production', correct: false }
- { value: 'docker service create --constraint node.labels.env == production', correct: true }
- { value: 'docker service create --label env=production', correct: false }
- { value: 'docker run --env production', correct: false }
help: https://docs.docker.com/engine/swarm/services/#placement-constraints

- uuid: b85fcb9d-9936-4a41-bc64-c54084ac0b36
question: Can node labels be used to filter nodes when scaling services?
answers:
- { value: "No, scaling ignores node labels", correct: false }
- { value: "Yes, placement constraints apply during scaling", correct: true }
- { value: "Only for global services", correct: false }
- { value: "Only for daemon sets", correct: false }
- { value: 'No, scaling ignores node labels', correct: false }
- { value: 'Yes, placement constraints apply during scaling', correct: true }
- { value: 'Only for global services', correct: false }
- { value: 'Only for daemon sets', correct: false }
help: https://docs.docker.com/engine/swarm/services/#placement-constraints

- uuid: 2a6e9114-8717-498e-8f65-7052ac28c3c6
question: How do you remove a label from a node?
answers:
- { value: "docker node update --label-rm <label>", correct: true }
- { value: "docker node label remove", correct: false }
- { value: "docker label rm", correct: false }
- { value: "docker node delete label", correct: false }
- { value: 'docker node update --label-rm <label>', correct: true }
- { value: 'docker node label remove', correct: false }
- { value: 'docker label rm', correct: false }
- { value: 'docker node delete label', correct: false }
help: https://docs.docker.com/reference/cli/docker/node/update/

- uuid: 45fc67df-81be-4b4b-a96f-4de88ac5856f
question: Can a service have multiple placement constraints?
answers:
- { value: "Only if --mode=global", correct: false }
- { value: "Only with node affinity enabled", correct: false }
- { value: "No, only one is allowed", correct: false }
- { value: "Yes, use multiple --constraint flags", correct: true }
- { value: 'Only if --mode=global', correct: false }
- { value: 'Only with node affinity enabled', correct: false }
- { value: 'No, only one is allowed', correct: false }
- { value: 'Yes, use multiple --constraint flags', correct: true }
help: https://docs.docker.com/engine/swarm/services/#placement-constraints
- uuid: f08f5a14-376a-4f56-a5d5-6b9ed18f82c5
question: Where are node labels stored in a Docker Swarm cluster?
answers:
- { value: "In the image layer", correct: false }
- { value: "In the Raft log replicated across all managers", correct: true }
- { value: 'In the image layer', correct: false }
- { value: 'In the Raft log replicated across all managers', correct: true }
- { value: "Only in the local node's filesystem", correct: false }
- { value: "In container metadata", correct: false }
- { value: 'In container metadata', correct: false }
help: https://docs.docker.com/engine/swarm/how-swarm-mode-works/nodes/

- uuid: 7a233b58-f90a-4692-bfa2-2466c86b6303
question: What happens if a node with a required label is removed from the cluster?
answers:
- { value: "The label is ignored and the task is rescheduled anywhere", correct: false }
- { value: "The service is stopped entirely", correct: false }
- { value: "The cluster auto-applies the label to another node", correct: false }
- { value: "Tasks using that constraint are rescheduled only if another node has the label", correct: true }
- { value: 'The label is ignored and the task is rescheduled anywhere', correct: false }
- { value: 'The service is stopped entirely', correct: false }
- { value: 'The cluster auto-applies the label to another node', correct: false }
- { value: 'Tasks using that constraint are rescheduled only if another node has the label', correct: true }
help: https://docs.docker.com/engine/swarm/services/#placement-constraints

- uuid: b2e91bbf-21fa-4fd9-8c83-e4a64676e750
question: Which file can define placement constraints when using docker stack deploy?
answers:
- { value: "swarm-config.json", correct: false }
- { value: "Dockerfile", correct: false }
- { value: "service.conf", correct: false }
- { value: "docker-compose.yml with 'deploy.placement.constraints'", correct: true }
- { value: 'swarm-config.json', correct: false }
- { value: 'Dockerfile', correct: false }
- { value: 'service.conf', correct: false }
- { value: 'docker-compose.yml with deploy.placement.constraints', correct: true }
help: https://docs.docker.com/compose/compose-file/compose-file-v3/#placement

- uuid: 6eb90544-0bdf-49ea-b6ed-4fcad88fc7b7
question: Which command shows all nodes with their labels?
answers:
- { value: "docker service inspect --labels", correct: false }
- { value: "docker node show-labels", correct: false }
- { value: "docker inspect --type node", correct: false }
- { value: "docker node ls && docker node inspect <node>", correct: true }
- { value: 'docker service inspect --labels', correct: false }
- { value: 'docker node show-labels', correct: false }
- { value: 'docker inspect --type node', correct: false }
- { value: 'docker node ls && docker node inspect <node>', correct: true }
help: https://docs.docker.com/reference/cli/docker/node/inspect/
Loading