Hi, David
Thanks for your reqly. If I understand you correctly, the two uses of EXPOSE in the dockerfile are
-
“as a hint to the next person to maintain the system” so that they know what are the ports should be published when runs the image.
-
When running the image with
-P
, the exposed ports in dockerfile will be published to avoid a long list of-p
for individual ports.
Is my understanding correct? Thanks.