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

Unable to port bind to specific interface for given exposed port, leaving external port random #89

Open
corradio opened this issue Oct 30, 2014 · 1 comment
Assignees
Milestone

Comments

@corradio
Copy link
Contributor

It's currently not possible to bind an exposed port to a random external port, specifying the interface.

and the docker-py api supports it like this:

c.start(container_id, port_bindings={1111: ('127.0.0.1',)})

ref: https://github.com/docker/docker-py/blob/4ed1ee5b0fc8c527e96ff00cba23f69420617454/docs/port-bindings.md

It's a shame because we need this to allow proper service discovery on a specific interface :)

Also, Fig supports it with:

ports:
        - "10.181.8.1::9005"
@mpetazzoni
Copy link
Contributor

You're correct, it's not possible to map to a random external port. I didn't implement support for this because I had a hard time figuring out a good use case for it, but I guess I could look into it.

@mpetazzoni mpetazzoni added this to the Future milestone Oct 30, 2014
@mpetazzoni mpetazzoni self-assigned this Oct 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants