diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index efc314b..aaa04d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. --- @@ -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 diff --git a/README.md b/README.md index 11e9fd9..f0559e3 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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** diff --git a/data/1_Orchestration/add_networks_publish_ports.yaml b/data/1_Orchestration/add_networks_publish_ports.yaml index 7b38127..84358f6 100644 --- a/data/1_Orchestration/add_networks_publish_ports.yaml +++ b/data/1_Orchestration/add_networks_publish_ports.yaml @@ -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/ diff --git a/data/1_Orchestration/apply_node_labels_placement_tasks.yaml b/data/1_Orchestration/apply_node_labels_placement_tasks.yaml index 46eccac..caa2187 100644 --- a/data/1_Orchestration/apply_node_labels_placement_tasks.yaml +++ b/data/1_Orchestration/apply_node_labels_placement_tasks.yaml @@ -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 --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 --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