🎙 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 9 of 10

An app inside a container listens on 127.0.0.1:3000 and docker run -p 3000:3000 does not reach it. Why?

An app inside a container listens on 127.0.0.1:3000 and docker run -p 3000:3000 does not reach it. Why?

  1. A.Port 3000 is reserved by Docker
  2. B.The image is too large
  3. C.The container has no volume
  4. D.127.0.0.1 inside the container accepts only connections from inside it; the app must listen on 0.0.0.0
Answer & explanation

Correct answer: 127.0.0.1 inside the container accepts only connections from inside it; the app must listen on 0.0.0.0

Port forwarding arrives on the container's network interface, not its loopback.

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 →