Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish random port #123

Closed
SbiCA opened this issue Aug 12, 2019 · 1 comment
Closed

Publish random port #123

SbiCA opened this issue Aug 12, 2019 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@SbiCA
Copy link

SbiCA commented Aug 12, 2019

Is your feature request related to a problem? Please describe.
At the moment it is possible to publish a port with a specified binding pair (host, container) whereas in some scenarios I'd like to be able to just specify the container port and let the engine decide on the published host port e.g. docker run -p 80 XZY. This helps in scenarios such as running a database in integration test scenarios on two points:

  • You can still run for instance a postgres instance on the default port
  • You can run test in parallel

Describe the solution you'd like
Overload for WithPortBinding that accepts only the container port

Describe alternatives you've considered
New method WithRandomPortBiding would make it more clear to the user

Cheers & let me know if you like me to create a PR for it

@HofmeisterAn
Copy link
Collaborator

Hi @SbiCA, good feature request. The same applies here as for #122.
Help is always appreciated. I try to support as much as I can.

@HofmeisterAn HofmeisterAn added the enhancement New feature or request label Aug 13, 2019
@HofmeisterAn HofmeisterAn added this to the 0.0.9 milestone Aug 13, 2019
HofmeisterAn added a commit that referenced this issue Aug 13, 2019
…ontainersBuilder'

{Add parameter assignRandomHostPort to bind container ports to random host ports.}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants