🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Using the service name db as the hostname
  2. B.Using localhost
  3. C.Using the host's public IP
  4. 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 →