Print the public port for a port binding 显示端口绑定的公共端口
用法
1
port [options] SERVICE PRIVATE_PORT
选项
1 2 3
Options: --protocol=proto tcp or udp [default: tcp] --index=index index of the container if there are multiple instances of a service [default: 1]
注意
无
示例
1 2 3 4 5 6
$ docker-compose port demo 80 0.0.0.0:80 $ docker-compose port --index=1 demo 80 0.0.0.0:80 $ docker-compose port --index=2 demo 80 ERROR: No container found for demo_2