DOCKER-COMPOSE-PORT(1)
π docker-compose-port π
okay bestie, welcome to the docker-compose-port page, aka the little glow-up that tells you which public port your container is actually wearing β¨ it lives inside the docker-compose manual family, so if you ever get lost just yell for its parent π«Ά
β¨ NAME β¨
docker-compose-port β print the public port for a port binding π
no cap, that's literally the whole job. it looks at a port binding and tells you the public side of it. iconic behaviour honestly.
πΈ SYNOPSIS πΈ
docker compose port [OPTIONS] SERVICE PRIVATE_PORT
so you give it a SERVICE, you give it a PRIVATE_PORT, and it hands you back the public port. the way that it just works ππ
π¦ DESCRIPTION π¦
Prints the public port for a port binding π
that's it. that's the vibe. you ask, it answers, everyone moves on with their day. main character energy fr fr.
π OPTIONS π
-h,--help[=false]β help for port πββοΈ when you need the manual to explain the manual. set it tofalse(the default) and it just chills.--index=0β Index of the container if service has multiple replicas π―ββοΈ because sometimes your service is not one (1) singular container, it's a whole friend group, and you gotta say which one. default is0.--protocol="tcp"β tcp or udp π pick your transport, bestie. default is"tcp".
π OPTIONS INHERITED FROM PARENT COMMANDS π
--dry-run[=false]β Execute command in dry run mode π§ pretend you did the thing without actually doing the thing. rehearsal era. default isfalse.
π SEE ALSO π
docker-compose(1)β the parent, the origin, the mothership π go say hi.
β οΈ real talk: these are inherited options, so they're coming from the parent command, not from port itself. don't be confused, be informed π
okay and that's the whole page!! this gorgeous little number is from the Mar 2025 release of the DOCKER-COMPOSE-PORT(1) manual β go forth, find your public ports, and slay π
β¨π
π¦ where this page comes from
- debian trixie: docker-compose 2.26.1-4 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms