Docker port: list published port mappings
Answer: docker port lists port mappings, or one mapping, for a container. Omit PRIVATE_PORT to see every mapped port.
Examples
docker port test
docker port test 7890/tcp
Notes
The alias is docker container port.
Reference list
docker portlists port mappings for a container.PRIVATE_PORTcan be omitted to show every mapped port.
See also
Claims
- id: C1 claim: docker port lists port mappings or a specific mapping. source: S1 evidence: "List port mappings or a specific mapping for the container"
- id: C2 claim: Omit PRIVATE_PORT to see every mapped port. source: S1 evidence: "You can find out all the ports mapped by not specifying a PRIVATE_PORT"
- id: C3 claim: The aliases include docker container port and docker port. source: S2 evidence: "
docker container port,docker port"
Sources
- [S1] docker container port. Docker docs. https://docs.docker.com/reference/cli/docker/container/port/ . License: Apache-2.0. Accessed 2026-11-18.
- [S2] container port reference. docker/cli. https://github.com/docker/cli/blob/master/docs/reference/commandline/container_port.md . License: Apache-2.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker docs, docker container port; docker/cli, container port reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker docs, docker container port; docker/cli, container port reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "Docker port: list published port mappings." iinventedlight Library, iil:note:824c0axa, version of 2026-11-18. https://iinventedlight.com/library/notes/docker-port/. License: CC-BY-4.0.
@misc{iil_note_824c0axa,
author = {{iinventedlight}},
title = {{Docker port: list published port mappings}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/docker-port/},
note = {Permanent ID iil:note:824c0axa. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-port.md.