There seems to be no documentation for the withPortSpecs method on CreateContainerCommand. It seems to have replaced withPortBindings in a recent release, but there isn't any documentation on how to use it.
Me too锛寃ithPortBindings has been work until version 3.1.0-rc-5
Did version 3.1 really remove the method withPortBindings?
If yes, I'm really missing some working example in the documentation
https://github.com/docker-java/docker-java/wiki#create-new-docker-container-and-start-it-with-exposed-ports
@zpapez Yes. withPortBindings doesn't exist anymore. As far as your example is concerned, you can look at this test in order to update the wiki: https://github.com/docker-java/docker-java/blob/master/src/test/java/com/github/dockerjava/cmd/CreateContainerCmdIT.java#L538
But that doesn't use withPortSpecs. There don't seem to be any tests that use withPortSpecs either.
@noahmonster I think the withPortBindings should be now used through HostConfig, correct?
I prepared an update of wiki in my fork https://github.com/zpapez/docker-java/wiki
Could you please check? I did not find a way to open a wiki pull request.
@zpapez tested the new way of configuring host port mappings and it works. The changes you proposed should be merged.
@IonutCiuta where is it merged? I still do not see the updated approach through HostConfig in the main wiki at:
https://github.com/docker-java/docker-java/wiki#create-new-docker-container-and-start-it-with-exposed-ports
It isn't. That's what I was saying. The pull request should be merged.
@IonutCiuta as I said I did not find a way to open a wiki pull request.
So there is no such pull request that can be merged...
Any update on this ? I'm running into this as well.
Wiki is no longer used. Please see https://github.com/docker-java/docker-java/tree/master/docs
Most helpful comment
Any update on this ? I'm running into this as well.