Port
If you've built any multi-container applications, chances are you've had to define some rules in order to manage ports. There are several ways to do this:
--expose
flag at runtimeEXPOSE
instruction in the Dockerfilepublish ports by using the
-p
or-P
flags withhyper run
The behavior of container port in Hyper is very simple:
All containers in the same network are inter-accessible; all ports are open within the network by default
-P
flag publishes all ports exposed by--expose
flag at runtime, orEXPOSE
instruction in the Dockerfile-p
creates a port mapping rule like-p hostPort:containerPort
.containerPort
is required. If nohostPort
is specified, Hyper will use the same port ascontainerPort
Last updated