2021年4月5日星期一

Docker: what is the difference in docker ps output between 123-125/tcp and 0.0.0.0:123-125->123-125/tcp notations?

After starting docker container with standart command ...

docker run -p 123-125:123:125 -it <container_name> "bin/bash"   

... and exiting it with CTRL-P + CTRL-Q, I noticed that suddenly I see 2 blocks in port column of docker ps output:

100:102/tcp, 0.0.0.0:123-125:123:125/tcp

I was never setting 100:102 ports for my container.

I cannot get 2 things:

  1. what is the difference between these 2 notations: 100:102/tcp and 0.0.0.0:123-125:123:125/tcp in docker ps output?
  2. why I have additional 100:102/tcp output in docker ps if my -p parameter was only listing 123-125:123:125/tcp?
https://stackoverflow.com/questions/66949750/docker-what-is-the-difference-in-docker-ps-output-between-123-125-tcp-and-0-0-0 April 05, 2021 at 03:44PM

没有评论:

发表评论