docker-java/docker-java — pull request #82 by albers (2014-10-26 17:20:05+00:00)
Title: Allow multiple port bindings per ExposedPort

docker-java currently maps the Docker API elements _.HostConfig.PortBindings_ and _.NetworkSettings.Ports_ to a `Map`. This is incorrect. There may be multiple Bindings per ExposedPort. The API element is an array.

To illustrate, create a container with `docker run -d -p 80:80 -p 81:80 eboraas/apache:latest`. Docker remote API will report

> "PortBindings":{"80/tcp":**[**{"HostIp":"","HostPort":"80"}**,**{"HostIp":"","HostPort":"81"}**]**}
> "Ports":{"443/tcp":null,"80/tcp":**[**{"HostIp":"0.0.0.0"**,**"HostPort":"80"},{"HostIp":"0.0.0.0","HostPort":"81"}**]**}}

docker-java will only give you access to the first Binding, as shown by the test contributed in d1f31cdfb0716c976eff6051f00fc8896cfc75c8. There is no way to create multiple port bindings per ExposedPort with the current state of docker-java.

This PR changes the type used for storing port bindings to `Map`, solving both problems.