When launching dockers, you can specify which ports you want to be accessible to the outside world. The basic syntax is:
docker run -p hostPort:containerPort imageName
or simply
docker run -p hostPort imageName
In the first case, the external is used hostPort
, but inside the container: containerPort
will be used. In the second case, you will simply use this port both inside and outside your container.
, EXPOSE Docker.