1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #2482 from elee/patch-1

correct assignment of $PORT from docker port output
This commit is contained in:
Andy Rothfusz 2013-10-31 12:18:24 -07:00
commit d5891f9fb0

View file

@ -147,7 +147,7 @@ Expose a service on a TCP port
JOB=$(sudo docker run -d -p 4444 ubuntu:12.10 /bin/nc -l 4444)
# Which public port is NATed to my container?
PORT=$(sudo docker port $JOB 4444)
PORT=$(sudo docker port $JOB 4444 | awk -F: '{ print $2 }')
# Connect to the public port via the host's public address
# Please note that because of how routing works connecting to localhost or 127.0.0.1 $PORT will not work.