I really don’t understand the point of using EXPOSE.
If I want to talks between containers I use named networks with bridge, if I want to access from outside I use port publish/mapping.
Why “expose” ports?
Thanks.
Share and learn in the Docker community.
I really don’t understand the point of using EXPOSE.
If I want to talks between containers I use named networks with bridge, if I want to access from outside I use port publish/mapping.
Why “expose” ports?
Thanks.
Please look at this old thread
(or
-p` ) is a way of mapping a host port to a running container port
Also, if there is ports that have been defined in EXPOSE, you can use “docker run -P” and it will auto map the ports that is listed in the image