Expose of dockerfile

  docker, dockerfile

EXPOSE instruction

The instruction is that the Docker mirror tells the Docker host application which port to listen on.
You can also use-expose = [] at run time to overwrite it.

Publishing container port

The expose port only makes the port available in the container. For those applications that need to provide services to applications other than the Docker host, the port needs to be published.

–publish-all/-P

Publish all expose ports in the container to random high-order ports on the Docker host computer

–publish/-p

Publishing Container Ports to Docker Host