Open ma-Tehwush opened 6 months ago
The hover on the "appPort"
property shows:
Application ports that are exposed by the container. This can be a single port or an array of ports. Each port can be a number or a string. A number is mapped to the same port on the host. A string is passed to Docker unchanged and can be used to map ports differently, e.g. "8000:8010".
This could be clarified a bit by saying that the number syntax will only listen on that port on the loopback network interface.
Thank you for clarification :)
Actually I only have read docs from:
I would say these also could be improved.
In devcontainers.json when I have:
"appPort": ["8000:8000"]
and I build container, ports are like this: But when I have"appPort": [8000]
they are like this: I thought these two settings were doing the same. But actually, bare 8000 number forwards only 127.0.0.1 which won't allow connections from outside of the host machine.Is it a bug or a feature?