Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It clearly states “this will publish the mentioned port to the outside world”. How do you expect this to work? Magic?


No, it doesn't. That's not written anywhere on the page. And even if it were, the obvious interpretation of "outside world" would just be that it's available outside the container. And maybe that it's bound to the external network interfaces, but not that it bypasses the firewall.


The documentation clearly states that ports are published. You just didn't follow up on it. Publishing is a docker term different from exposing. There is information on the page about exposing a port without publishing it. Under `long syntax` there is the following information: "published: the publicly exposed port" [0]. How much more clear than "publicly exposed" can you get?

What is a published port? Again, look in the documentation, it's clearly states there [1].

You need to learn to read the documentation of potentially dangerous tools fully. If you don't, you're in for a world of hurt. The outside world is clearly just that.

[0]: https://docs.docker.com/compose/compose-file/compose-file-v3... [1]: https://docs.docker.com/config/containers/container-networki...


Except it is not clear at all and should mention the firewall changes. I expect that publishing means listening on 0.0.0.0, not messing with the firewall.


See my comment above. Firewall changes are clearly mentioned under the section "published ports".

What you expect does not matter. What you're thinking of is exposing. It's even in the word "publish".

The documentation has two sections entirely devoted to the terms. It's in the section "container networking", which is marked as required reading by the docs.

It's not dockers fault that you're copy pasting configuration examples from medium blogs.

[0]: https://docs.docker.com/config/containers/container-networki...


You know, it would be nice for you to actually read the docs before posting insulting comments.

> This creates a firewall rule in the container

We’re done here.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: