The Dockerfile command EXPOSE
and the docker run
argument --expose
tells docker that the port must be exposed.
When publishing ports with -p
, you can map an outer host port to a different inner container port, e.g. docker run -p 8080:80
, where 8080
is the host port and 80
is the container port.
My question is, does EXPOSE
refer to the inner container port or the outer host port?
The EXPOSE
instruction in a Dockerfile refers to the container port.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With