Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev Containers: Possible bug with "appPort" property #9890

Open
ma-Tehwush opened this issue May 16, 2024 · 2 comments
Open

Dev Containers: Possible bug with "appPort" property #9890

ma-Tehwush opened this issue May 16, 2024 · 2 comments
Assignees
Labels
containers Issue in vscode-remote containers doc

Comments

@ma-Tehwush
Copy link

In devcontainers.json when I have: "appPort": ["8000:8000"] and I build container, ports are like this:
8000string
But when I have "appPort": [8000] they are like this:
8000number
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?

@VSCodeTriageBot VSCodeTriageBot added the containers Issue in vscode-remote containers label May 16, 2024
@chrmarti
Copy link
Contributor

chrmarti commented May 28, 2024

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.

@chrmarti chrmarti added the doc label May 28, 2024
@ma-Tehwush
Copy link
Author

Thank you for clarification :)

Actually I only have read docs from:

I would say these also could be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers doc
Projects
None yet
Development

No branches or pull requests

3 participants