withBindPorts method
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;
}