Text preview & study summary
Docker DCA - Certified Associate - Orchestration Image Creation Registry Networking Storage Security
A free sample of 5 questions from this quiz, shown in full with answer choices and explanations. No interactivity — everything is visible on this page for study and review.
Want to test your knowledge? Launch the Interactive Exam Simulator
Question 1
A security team requires that containers run with read-only root filesystems to prevent unauthorized writes. A developer implements `docker run --read-only myapp` but the application fails because it needs to write to `/tmp`. What is the correct solution?
Explanation
`--tmpfs /tmp` creates an ephemeral, in-memory tmpfs mount at `/tmp` that is writable, while the rest of the container's filesystem remains read-only. This is the recommended pattern: `docker run --read-only --tmpfs /tmp myapp`. Named volumes (option C) would also work for persistent storage but are heavier than tmpfs for temporary data. `--privileged` (option D) grants container access to all host devices and capabilities — it doesn't affect the read-only filesystem policy and is a security anti-pattern.
Question 2
A developer runs `docker exec -it <container_id> bash` but receives the error `OCI runtime exec failed: container is not running`. What does this indicate?
Explanation
`docker exec` attaches to a running container and executes a command within it. If the container is stopped or has exited, `docker exec` cannot be used. To investigate a stopped container: use `docker logs <container_id>` to see output, `docker inspect <container_id>` to check exit code and status, or `docker start <container_id>` to restart it. Option A (paused container) would show a different error. Option C would show `executable file not found in $PATH`.
Question 3
A team is using Docker Swarm for container orchestration. They deploy a service with `docker service create --replicas 3 --name web nginx:latest`. One of the 3 nodes becomes unavailable. What does Docker Swarm do?
Explanation
Docker Swarm maintains a desired state model. The swarm manager continuously reconciles desired state (3 replicas) with actual state. When a node fails, the replicas running on it are lost, and Swarm automatically schedules replacement replicas on healthy nodes. This is a core feature of container orchestration — self-healing. The service continues to serve traffic from the 2 healthy replicas while the 3rd is being rescheduled.
Question 4
A developer creates a Docker network: `docker network create --driver overlay mynet`. Which statement about overlay networks is correct?
Explanation
Docker overlay networks use VXLAN encapsulation to create a virtual Layer 2 network spanning multiple Docker Swarm nodes. Containers on different physical hosts but connected to the same overlay network can communicate using container/service names as DNS hostnames (via Docker's built-in DNS). Overlay networks are built into Docker Swarm — no third-party plugin is needed (though plugins like Weave, Calico can replace the default). They require Swarm mode to be active and use ports 4789 (VXLAN) and 7946 (control plane).
Question 5
A Docker Swarm service is deployed with `--update-parallelism 2 --update-delay 30s`. The service has 10 replicas and needs to be updated. Which statement describes the update behavior?
Explanation
`--update-parallelism 2` means 2 replicas are updated simultaneously in each batch. `--update-delay 30s` is the delay BETWEEN batches (not within). For 10 replicas: batch 1 (replicas 1-2) → 30s pause → batch 2 (replicas 3-4) → 30s pause → ... → batch 5 (replicas 9-10). Minimum total: 5 batches × 30s delay = ~150 seconds (plus actual update time for each replica). `--update-order` controls whether new replicas start before old ones stop (`start-first`) or after (`stop-first`, default).
