-
Notifications
You must be signed in to change notification settings - Fork 7.6k
docs: Add documentation for IP:HOST_PORT:CONTAINER_PORT syntax #22511
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
base: main
Are you sure you want to change the base?
Conversation
Add explanation and examples for binding ports to specific network interfaces using the extended syntax. This addresses issue docker#22253.
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @Antraxmin - thank you for working on this, it looks good. As @akerouanton noted on the issue, a wider review of the port publishing documentation is needed. It's got quite complicated, and the documentation is incomplete and split between a few places. But, that shouldn't stop us from making this incremental improvement first. In the meantime though ... I think it'd be good to add a link from this new section to https://docs.docker.com/engine/network/packet-filtering-firewalls/#setting-the-default-bind-address-for-containers - it partially describes config param The "Important" note just above this new section hints at what's described in this new text, and links to another page with some of the same description - which might be confusing. Perhaps change change its last sentence to "See [Binding to specific network interfaces] below, and [learn more about published ports here]."? |
Hi @robmry , thank you for your review and suggestions!
I completely understand this is just an incremental improvement while a more comprehensive review of port publishing documentation is pending. I hope this small addition helps users in the meantime. If there's anything I misunderstood, please let me know. If there's no particular problem, I'll work on it in more detail! |
Thank you @Antraxmin - that sounds great, much appreciated. |
I've updated the PR with the requested changes: 8ad69cc
These changes should help users better understand the options available for controlling which network interfaces their container ports are bound to. Let me know if any further adjustments are needed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you!
@robmry Oops, you already approved this PR, but I accidentally hit the request review button. Please ignore the second request. My mistake! |
No worries! We'll need a review from Docker's docs team, and I think they're a bit short-handed at the moment. |
Add explanation and examples for binding ports to specific network interfaces using the extended syntax. This addresses issue #22253.
Description
Added documentation for the extended port publishing syntax
IP:HOST_PORT:CONTAINER_PORT
, which was missing from the current documentation. This change improves the "Publishing and exposing ports" page by explaining how to bind container ports to specific network interfaces on the host machine.The additions include:
This documentation helps users understand how to restrict container access to specific network interfaces, which is especially important for securing sensitive services like databases.
Related issues or tickets
Fixes #22253
Reviews