Skip to content

Missing <IP>:<host_port>:<container_port> explaination docker-compose #22253

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

Open
1 task done
JoachimBose opened this issue Mar 15, 2025 · 2 comments
Open
1 task done
Labels
area/get-started Relates to get started and onboarding docs area/networking Relates to anything around networking lifecycle/frozen status/triage Needs triage

Comments

@JoachimBose
Copy link

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

I can't find what I'm looking for

Description

The website provides very helpful information about the <host_port>:<container_port> syntax for exposing ports in Docker Compose. However, it does not seem to explain anything about the extended :<host_port>:<container_port> syntax.

Location

https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports/

Suggestion

dd a section in the documentation that explicitly covers this syntax and includes examples of how and when it can be used. Unfortunately I am nowhere near an expert in this (hence why I tried to look it up).

Thank you! Cheers

@JoachimBose JoachimBose added the status/triage Needs triage label Mar 15, 2025
@craig-osterhout craig-osterhout added the area/get-started Relates to get started and onboarding docs label Mar 17, 2025
@thaJeztah thaJeztah added the area/networking Relates to anything around networking label Mar 18, 2025
@thaJeztah
Copy link
Member

Thanks for reporting; there are some additional links at the bottom of the page (under "Additional resources) linking to the "published ports" section; https://docs.docker.com/engine/network/#published-ports

That said, I think there's some information spread across the documentation that we might be able to consolidate to provide a more in-depth overview of the available options, and to describe the short-form and long-form syntax

/cc @robmry @akerouanton

@akerouanton
Copy link
Member

akerouanton commented Mar 18, 2025

Indeed, port mapping became a complex subject over time and information is spread all over the place. I think we should have a dedicated page that explain how it works and the various options that can influence it, including:

  • Long and short syntax
  • What the label com.docker.network.bridge.host_binding_ipv4 does, and how to configure it globally
  • How port folding / port expansion work
  • Hairpinning and what docker-proxy does
  • What the label gw_mode does

And probably more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/get-started Relates to get started and onboarding docs area/networking Relates to anything around networking lifecycle/frozen status/triage Needs triage
Projects
None yet
Development

No branches or pull requests

4 participants