Skip to content

Publishing Ports in Docker

Ports are published while creating image using Dockerfile

publishing instructions are added as EXPOSE with port number

Like

EXPOSE 80

or

EXPOSE 80
EXPOSE 443

or

EXPOSE 8080/tcp
EXPOSE 53/udp

:::info If we publish any port irrespective of if it is actually listening by any service or not these instructions will be printed in ports publishing instructions :::

:::note We do not have any options available by docker or Padman to identify actually which ports are used by any services.
Only way to identify is, attach the terminal of the container and run the commands to list open ports :::