Search code examples
docker

Why multiple docker containers can have the same internal port


Consider this two docker container run commands:

docker container run --publish 89:80 ImageFoo
docker container run --publish 90:80 ImageBoo

Why multiple docker container can have the same right port?


Solution

  • Port on the right, is inside the container. Each container has its own virtual network adapter, thus you are able to use the whole port range independently.