docker-java/docker-java — pull request #87 by albers (2014-10-31 14:30:01+00:00)
Title: Improve adding of port bindings

Adding port bindings involves the creation of a Ports object that has a confusing notion of bindings: in order to add a port binding, you `Ports.bind` a `Binding` and hand it over to `withPortBinding`.

Other builder methods offer more intuitive idioms that directly correspond to Docker CLI options, e.g. `withBinds(Bind...)` and `withLinks(Link...)`.

With this PR, you can do things like

> StartContainerCmd.withPortBindings( PortBinding.parse("80:8080/tcp") );

The old way of working with `Ports` still exists. Querying port bindings from an `InspectContainerResponse` was not changed.

See individual commit messages for details.