← All notes

Docker Swarm ingress: publish ports through the routing mesh

Answer: In Swarm mode, every node joins an ingress routing mesh that forwards published ports to running tasks.

How the mesh publishes a port

Incoming requests to published ports are routed to an active container.

The --publish flag publishes a port when you create a service.

target is the port inside the container; published is the port bound on the routing mesh.

If you omit the published port, a random high-numbered port is bound.

Protocols and host mode

By default, a published port is a TCP port.

You can publish UDP instead of, or as well as, TCP.

Docker effectively load-balances swarm services through this mesh.

To skip the mesh for a service, use the long --publish form and set mode to host.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Use Swarm mode routing mesh; Docker, Inc., Use Swarm mode routing mesh (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Use Swarm mode routing mesh; Docker, Inc., Use Swarm mode routing mesh (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.

Cite this

Permanent ID: iil:note:gagnneey

iinventedlight. 2026. "Docker Swarm ingress: publish ports through the routing mesh." iinventedlight Library, iil:note:gagnneey, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-swarm-ingress/. License: CC-BY-4.0.

@misc{iil_note_gagnneey,
  author = {{iinventedlight}},
  title = {{Docker Swarm ingress: publish ports through the routing mesh}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-26},
  url = {https://iinventedlight.com/library/notes/docker-swarm-ingress/},
  note = {Permanent ID iil:note:gagnneey. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-swarm-ingress.md.