DCA Communication & Stakeholder Relations 4 — Questions and Answers
Question 1: A team lead asks how services in a Docker Swarm discover each other without hardcoding IP addresses. What mechanism enables this?
- Swarm's built-in DNS-based service discovery (Correct answer)
- Static /etc/hosts entries injected at startup
- External Consul service catalog only
- Manual IP assignment via environment variables
Correct answer: Swarm's built-in DNS-based service discovery
Docker Swarm provides built-in DNS-based service discovery where service names resolve to virtual IPs automatically.
Question 2: An architect wants to communicate the difference between published ports and exposed ports to developers. Which statement is accurate?
- EXPOSE documents intent but does not publish; -p actually maps the port to the host (Correct answer)
- EXPOSE and -p are functionally identical
- -p only works between containers, not to the host
- EXPOSE automatically publishes the port externally
Correct answer: EXPOSE documents intent but does not publish; -p actually maps the port to the host
EXPOSE is metadata documenting which ports the container listens on, while -p actually binds the port to the host network interface.
Question 3: A QA manager asks how to pass environment-specific configuration to containers without rebuilding images. What is the recommended approach?
- Use -e flags or --env-file to inject environment variables at runtime (Correct answer)
- Bake all config into the image at build time
- Mount a config volume with hardcoded paths
- Use docker commit after setting variables
Correct answer: Use -e flags or --env-file to inject environment variables at runtime
Injecting environment variables at runtime via -e or --env-file keeps images environment-agnostic and reusable.
Question 4: A security stakeholder wants to know how Docker secrets differ from environment variables for sensitive data. What is the key distinction?
- Secrets are stored encrypted in Swarm Raft and mounted in-memory; env vars are visible in inspect output (Correct answer)
- Secrets and environment variables offer identical security
- Secrets are stored in plain text files on the host
- Environment variables are encrypted by default in Docker
Correct answer: Secrets are stored encrypted in Swarm Raft and mounted in-memory; env vars are visible in inspect output
Docker secrets are encrypted at rest in the Swarm Raft store and mounted as tmpfs files, unlike env vars which appear in `docker inspect` output.
Question 5: A release manager asks how to roll back a Docker Swarm service update that introduced errors. Which command should you use?
- docker service rollback <service> (Correct answer)
- docker service update --rollback <service>
- docker swarm revert <service>
- docker rollback service <service>
Correct answer: docker service rollback <service>
`docker service rollback <service>` reverts a service to its previous configuration in Docker Swarm.
Question 6: An operations team needs to communicate volume usage to a storage stakeholder. Which command lists all Docker volumes on a host?
- docker volume ls (Correct answer)
- docker inspect volumes
- docker ps --volumes
- docker info --volumes
Correct answer: docker volume ls
`docker volume ls` lists all volumes managed by Docker on the local host.
Question 7: A developer asks how to verify that a container's published port is actively accepting connections before marking it ready. What Docker feature supports this?
- HEALTHCHECK instruction in the Dockerfile (Correct answer)
- EXPOSE instruction alone
- CMD with a port-bind test
- ENV PORT variable
Correct answer: HEALTHCHECK instruction in the Dockerfile
HEALTHCHECK defines a command Docker runs periodically to determine if the container is healthy and ready.
A team lead asks how services in a Docker Swarm discover each other without hardcoding IP addresses.
What mechanism enables this?