withBindPorts method

DockerContainer withBindPorts(
  1. int containerPort, [
  2. int? hostPort
])

Maps containerPort to an optional fixed hostPort.

When hostPort is null, the Docker daemon assigns an ephemeral port.

Returns this for chaining.

Implementation

DockerContainer withBindPorts(int containerPort, [int? hostPort]) {
  _ports[containerPort] = hostPort;
  return this;
}