← 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?
- A.Port 3000 is reserved by Docker
- B.The image is too large
- C.The container has no volume
- 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 →