--publish
(-p
) option
of the docker run
CLI command.
Enter one or more port binding, each on its own line.
The syntax is host container
where host
is either
hostPort
or hostIp:hostPort
and
container
is either containerPort
or containerPort/scheme
.
Alternatively, you can separate host and port with a colon (":"), thus using the same syntax as in the Docker CLI.
Examples