DCA Technology & Digital Tools 3 — Questions and Answers
Question 1: Which instruction in a Dockerfile is executed at container start time rather than at image build time?
- RUN
- COPY
- ENTRYPOINT (Correct answer)
- ADD
Correct answer: ENTRYPOINT
`ENTRYPOINT` defines the executable that runs when the container starts; `RUN` executes during the build phase.
Question 2: What is the purpose of Docker Content Trust (DCT)?
- Encrypts container network traffic
- Verifies the integrity and publisher of Docker images using cryptographic signatures (Correct answer)
- Controls user access to the Docker daemon
- Manages secrets in Docker Swarm
Correct answer: Verifies the integrity and publisher of Docker images using cryptographic signatures
DCT uses Notary to sign and verify image integrity, ensuring only trusted images are pulled and run.
Question 3: In Docker Swarm, what is a 'task'?
- A scheduled cron job inside a container
- An atomic unit of work representing one container instance of a service (Correct answer)
- A health-check probe definition
- A named network attached to a service
Correct answer: An atomic unit of work representing one container instance of a service
A task is the smallest schedulable unit in Swarm — it represents a single running container assigned to a node.
Question 4: Which `docker volume` sub-command removes all volumes not used by at least one container?
- docker volume rm --all
- docker volume delete --unused
- docker volume prune (Correct answer)
- docker volume clean
Correct answer: docker volume prune
`docker volume prune` deletes all dangling volumes — those not referenced by any container.
Question 5: When using multi-stage builds in Docker, what is the primary benefit?
- Faster network downloads during push
- Smaller final images by discarding build-time dependencies (Correct answer)
- Parallel execution of RUN instructions
- Automatic caching of all layers
Correct answer: Smaller final images by discarding build-time dependencies
Multi-stage builds let you compile or build in an early stage and copy only the artifacts into a lean final image, removing build tools.
Question 6: Which flag in `docker service create` limits the maximum amount of memory a service's tasks can use?
- --memory-limit
- --constraint memory
- --reserve-memory
- --limit-memory (Correct answer)
Correct answer: --limit-memory
`--limit-memory` sets the hard memory ceiling per task; if exceeded, the container's process may be OOM-killed.
Question 7: What does UCP stand for in Docker Enterprise?
- Unified Container Platform
- Universal Control Plane (Correct answer)
- Upstream Cluster Proxy
- User Configuration Panel
Correct answer: Universal Control Plane
UCP (Universal Control Plane) is Docker Enterprise's web UI and API layer for managing Swarm and Kubernetes clusters.
Which instruction in a Dockerfile is executed at container start time rather than at image build time?