Update ExposedPort to allow for port ranges by t-seemann · Pull Request #2618 · docker-java/docker-java
The following Dockerfile is currently not mappable by ExposedPort:
FROM busybox
EXPOSE 8000-8080
CMD ["/bin/sh", "-c", "while true; do sleep 1; done"]
as the ranges can not be represented. Port ranges can only be continuous, therefore portRangeFrom and portRangeTo parameters were introduced to express such ranges.
Single exposed ports are represented by portRangeFrom = portRangeTo.
To be backwards compatibale the old getPort() getter returns the first port of the range.
This should in all old use cases always return the same port as before. The getter was set to deprecated as user should use the new getPortRangeFrom() and getPortRangeTo().