← Quiz: Docker and Containers: all 10 questions
Quiz: Docker and Containers · Question 4 of 10
In the Compose file, how does the web service reach the database?
In the Compose file, how does the web service reach the database?
- A.Using the service name db as the hostname
- B.Using localhost
- C.Using the host's public IP
- D.It can't
Answer & explanation
Correct answer: Using the service name db as the hostname
Compose creates a shared network where each service name resolves to its container.
Can you get the rest right without peeking?
Take the timed Quiz: Docker and Containers quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →