Download DOCKER CERTIFIED ASSOCIATE (DCA) COMPREHENSIVE QUESTIONS and more Exams Information Technology in PDF only on Docsity!
DOCKER CERTIFIED ASSOCIATE (DCA) COMPREHENSIVE
QUESTIONS WITH - VERIFIED ANSWERS AND RATIONALES ||
RECENTLY RELEASED
Information Technology / Cloud Computing Exam coverage :-
- Section 1 (Q1–38): Orchestration
- Section 2 (Q39–69): Image Creation, Management, and Registry
- Section 3 (Q70–92): Installation and Configuration
- Section 4 (Q93–114): Networking
- Section 5 (Q115–132): Security
- Section 6 (Q133–150): Storage and Volumes DOMAIN 1: ORCHESTRATION (25%) – Questions 1– 38
- A DevOps engineer is setting up a Docker Swarm cluster for a production environment. The engineer has three nodes available and needs to configure them for high availability while ensuring that the cluster can tolerate the failure of at least one manager node. Which configuration should the engineer implement to meet this requirement? A) Deploy all three nodes as worker nodes and use an external load balancer for management
B) Deploy one manager node and two worker nodes, with the manager node backed up regularly C) Deploy three manager nodes in the swarm cluster to achieve
quorum and tolerate the failure of one manager ✔️
D) Deploy two manager nodes and one worker node, with automatic failover configured Rationale : A Docker Swarm cluster requires a quorum of manager nodes to maintain cluster state. With three manager nodes, the cluster can tolerate the failure of one manager and still maintain quorum (majority of 2 out of 3). Two managers would lose quorum if one fails, and a single manager is a single point of failure.
- A system administrator is managing a Docker Swarm cluster and needs to deploy a service that should run on every node in the cluster regardless of node count. The service is a logging agent that must collect logs from each node. Which service mode should the administrator use when creating this service? A) --mode global to ensure the service runs on every node in the
swarm ✔️
B) --mode replicated with replica count equal to the number of nodes C) --mode replicated with no replica specification D) --mode global with a replica count of 1
Which command should the administrator run next to diagnose why tasks are not starting? A) docker service logs B) docker service inspect --pretty to view service
configuration and constraints ✔️
C) docker node ls to check node availability D) docker swarm init to reinitialize the cluster Rationale : docker service inspect --pretty displays the service configuration, including constraints, resource limits, and placement preferences. This helps identify misconfigurations preventing task deployment. docker service logs only shows logs from running tasks.
- An engineer is deploying a service in a Docker Swarm cluster and needs to ensure that tasks are placed only on nodes with SSD storage. The engineer has already labeled the appropriate nodes with storage=ssd. Which command should the engineer use to enforce this placement constraint? A) docker service create --constraint node.hostname==ssd nginx B) docker service create --constraint node.labels.storage==ssd
nginx ✔️
C) docker service create --placement-pref node.labels.storage==ssd nginx
D) docker service create --label storage=ssd nginx Rationale : Node labels can be used as placement constraints with the syntax node.labels.==. This ensures tasks are only scheduled on nodes with the matching label.
- A developer is inspecting a container and wants to understand its network configuration, mounted volumes, and environment variables. Which command provides the most comprehensive view of a container's configuration? A) docker ps - a to list all containers B) docker logs to view container logs C) docker inspect to display detailed configuration
information ✔️
D) docker stats to view resource usage Rationale : docker inspect returns detailed JSON output containing all configuration details of a container, including network settings, mounts, environment variables, and labels.
- A DevOps engineer is managing a swarm cluster with five manager nodes. The engineer notices that the cluster is becoming unstable and some manager nodes are unresponsive. What is the minimum number of manager nodes that must remain operational for the swarm to continue functioning?
Rationale : Replicated services allow you to specify the number of replicas and Swarm ensures that many tasks are running. Scaling can be adjusted manually with docker service scale or integrated with external auto-scaling solutions.
- A developer is troubleshooting a service that is not starting in a swarm cluster. The service was created with the following command: docker service create --name web --publish 8080: nginx. The service tasks are stuck in a "Pending" state. Which command should the developer use to see detailed events and errors for this service? A) docker service logs web
B) docker service ps --no-trunc web ✔️
C) docker inspect web D) docker events --filter service=web Rationale : docker service ps --no-trunc shows the current state of tasks, including error messages when tasks fail to start. The --no- trunc flag ensures full error messages are displayed.
- An engineer is deploying a stack using a Docker Compose file. The engineer wants to increase the number of replicas for a service named api from 3 to 5. Which command should the engineer use to scale the service?
A) docker service update --replicas 5 api
B) docker service scale api=5 ✔️
C) docker stack scale api= D) docker compose up --scale api= Rationale : docker service scale is the command used to scale a service in a Swarm cluster. The syntax is docker service scale =.
- A cluster administrator is configuring a service that requires tasks to be distributed across nodes with specific hardware capabilities. The administrator has nodes with GPU labels and wants to ensure GPU tasks are placed only on GPU-enabled nodes. Which command correctly creates the service with this placement constraint? A) docker service create --placement-pref spread=node.labels.gpu nginx
D) Swarm supports depends_on only for global services Rationale : Docker Swarm does not honor the depends_on directive from Compose files. Services should be designed to handle dependencies gracefully, or health checks with update_config can be used to control rolling updates.
- A system administrator needs to lock a swarm cluster to prevent unauthorized access to the swarm's encryption keys. Which command locks the swarm?
A) docker swarm lock ✔️
B) docker swarm init --lock C) docker swarm unlock D) docker swarm update --lock Rationale : docker swarm lock enables the lock on the swarm. When locked, managers must use the unlock key to restart, preventing access to the swarm's encryption keys.
- A developer is running a container and wants to see which networks the container is connected to. Which command should the developer use? A) docker network ls B) docker container ls C) docker inspect --
format='{{.NetworkSettings.Networks}}' ✔️
D) docker network inspect Rationale : docker inspect with the --format flag can extract specific network information from the container's configuration. This shows all networks the container is attached to.
- An engineer is deploying a service in a Swarm cluster and wants to publish port 8080 on the host to port 80 in the container. The engineer also wants the service to be accessible externally. Which command correctly publishes the port?
C) docker swarm join --worker D) docker node join --worker Rationale : docker swarm join-token worker displays the token and command needed for a new worker node to join the swarm. The manager must run this command to generate the join token.
- A developer is inspecting a service's tasks and wants to see the node where each task is running and the task's current state. Which command provides this information? A) docker service logs
B) docker service ps ✔️
C) docker node ps D) docker service inspect Rationale : docker service ps lists all tasks of a service, showing the node each task is running on, the current state, and any errors.
- An engineer is deploying a service and wants to use a template for the service name that includes the node hostname. Which docker service create option supports templating? A) --name {{.Node.Hostname}}
B) --name {{.Node.Hostname}}-app with --template-driver ✔️
C) --hostname {{.Node.Hostname}} D) --label node={{.Node.Hostname}} Rationale : Docker Swarm supports templating in service creation. The --template-driver flag enables Go templating for fields like service name, hostname, and labels.
- A system administrator is troubleshooting a swarm cluster and suspects that a manager node has lost connectivity. Which command should the administrator use to check the status of all nodes in the swarm? A) docker service ls
D) docker stack deploy - c docker-compose.yml myapp --scale api= Rationale : The docker stack deploy command does not have a -- scale flag. The recommended approach is to deploy the stack and then scale the service using docker service scale.
- An engineer is managing a swarm cluster and wants to ensure that the cluster's certificates are automatically renewed. Which component handles certificate rotation in a Docker Swarm cluster? A) The Docker daemon on each node
B) The swarm's internal Certificate Authority (CA) ✔️
C) The UCP (Universal Control Plane) D) External Let's Encrypt integration Rationale : Docker Swarm has an internal CA that automatically rotates certificates for nodes and services. The CA is managed by the swarm itself and ensures secure communication between nodes.
- A developer is running a container and wants to create a new network for the container to use. Which command creates a user- defined bridge network?
A) docker network create --driver bridge mynet ✔️
B) docker network create mynet C) docker network create --driver overlay mynet D) docker network new mynet Rationale : docker network create with the --driver bridge flag creates a user-defined bridge network. The default driver is bridge if not specified, but explicitly specifying it is clearer.
- A cluster administrator needs to update a service's image to a new version without downtime. The administrator wants to control the update pace so that only one task is updated at a time. Which command should the administrator use? A) docker service update --image newimage:latest myservice
D) docker service logs Rationale : docker logs displays the logs from a container. This is the primary command for troubleshooting container startup issues.
- An engineer is deploying a service and wants to ensure that tasks are distributed evenly across all nodes in the swarm. Which placement preference should the engineer use? A) --constraint node.labels.zone==us-east
B) --placement-pref spread=node.id ✔️
C) --mode global D) --constraint node.hostname!=master Rationale : --placement-pref spread= distributes tasks evenly across nodes based on the specified attribute. spread=node.id distributes tasks across all nodes.
- A system administrator is managing a swarm cluster and wants to demote a manager node to a worker node. Which command should the administrator use?
A) docker node demote ✔️
B) docker node update --role worker C) docker node rm D) docker swarm demote Rationale : docker node demote demotes a manager node to a worker node. This is useful for reducing the number of managers in a cluster.
- A developer is building a multi-container application and wants to define the services, networks, and volumes in a single file for local development. Which file format and command should the developer use? A) Dockerfile with docker build