N
N
Nikolay2021-10-04 14:27:40
Debugging
Nikolay, 2021-10-04 14:27:40

Why doesn't VS Code debugger work with 127.0.0.1 (localhost) ip in Docker?

When I tried to set up the VS Code debugger, it was only able to connect after I specified the group address 0.0.0.0 to debug a NestJS application in a Docker container. Why couldn't I connect via localhost?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2021-10-04
@tryvols

The container inside has its own loopback interface isolated from the host system. Connecting to it is pointless.
Docker Containers and localhost: Cannot Assign Req...
Either forward the port or access the container's IP (this is possible in a native Linux environment, it will not work under Windows).

D
Dmitry, 2021-10-04
@dmtrrr

Because docker creates its own network and you need to explicitly forward the port out of the container.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question