Allow multiple port bindings per ExposedPort#82
Merged
marcuslinke merged 2 commits intodocker-java:masterfrom Oct 26, 2014
Merged
Allow multiple port bindings per ExposedPort#82marcuslinke merged 2 commits intodocker-java:masterfrom
marcuslinke merged 2 commits intodocker-java:masterfrom
Conversation
marcuslinke
added a commit
that referenced
this pull request
Oct 26, 2014
Allow multiple port bindings per ExposedPort
Contributor
|
@albers Thanks a lot! |
albers
added a commit
to albers/docker-build-step-plugin
that referenced
this pull request
Nov 4, 2014
Contributor
Author
|
Other projects have this API mismatch as well: docker/compose#624 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docker-java currently maps the Docker API elements .HostConfig.PortBindings and .NetworkSettings.Ports to a
Map<ExposedPort, Binding>. 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 reportdocker-java will only give you access to the first Binding, as shown by the test contributed in d1f31cd. 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<ExposedPort, Binding[]>, solving both problems.