XK0-006 Automation, Orchestration, and Scripting Practice Question
A DevOps team is designing a containerized application using Docker Compose. They need to ensure that the database container is started before the application container. Which of the following Docker Compose directives can be used to control startup order? (Choose TWO.)
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
depends_on
depends_on ensures that the specified services are started first. healthcheck can be used to wait for a service to be healthy before starting dependent services.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
volumes
Why it's wrong here
Volumes are for data persistence, not startup order.
- ✗
links
Why it's wrong here
links is deprecated and does not control startup order.
- ✗
environment
Why it's wrong here
Environment variables do not affect startup order.
- ✓
depends_on
Why this is correct
It specifies dependencies between services.
- ✓
healthcheck
Why this is correct
When combined with depends_on, it can wait for health status.
Go deeper
Related to this question
About these practice questions
One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.