-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add extra_hosts to yml configuration --add-hosts #1158
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
Conversation
1f61beb to
72f4e02
Compare
|
@tdesvenain @sampwing I have signed your commits after rebasing from the latest master. |
|
Great, thanks ! |
|
I am wondering if it is possible to add an alias to hosts:
- docker: 162.242.195.82
- fig: 50.31.209.229Thoughts? |
|
Shouldn't it be possible to add and extra_host that is another container, but not actually linked to the current container. Something like: |
|
@pedrokiefer Why not just use a link? You'll get the |
|
@pedrokiefer : What @aanand said, use |
|
I had some kind of circular dependency between containers, so I thought |
7d0ac5b to
7bf8f3a
Compare
|
rebased with CI fixes |
76f5fcb to
b68130a
Compare
|
@aanand I would appreciate your feedback/input with this PR. The integration tests are working well. Is there anything that I have missed? |
compose/service.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basestring should be six.string_types() for Python 3 compatibility
|
Added |
|
@aanand any updates to this PR? Any feedback would be appreciated |
|
|
…he --add-host flag from the docker client Signed-off-by: Sam Wing <sampwing@gmail.com>
|
@aanand Updated with |
|
Fantastic. Could you squash and rebase? Thanks. |
Added unit tests in build_extra_hosts + fix Signed-off-by: CJ <lim@chernjie.com>
linting... six.string_types list-of-strings in examples disallow extra_hosts support for list-of-dicts A more thorough sets of tests for extra_hosts Provide better examples As per @aanand's [comment](https://github.com/docker/compose/pull/1158/files#r28326312) I think it'd be better to check `if not isinstance(extra_hosts_line, six.string_types)` and raise an error saying `extra_hosts_config must be either a list of strings or a string->string mapping`. We shouldn't need to do anything special with the list-of-dicts case. order result to work with assert use set() instead of sort() Signed-off-by: CJ <lim@chernjie.com>
|
@aanand I have rebased and squashed all my commits. I have left the other author's contribution as individual commit so as not to lose their contribution information. I hope that's okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe 'extra_host': 'extra_hosts', as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added @ 86a08c0
|
I like this, I think it addresses the "external" type described in #988 LGTM |
Signed-off-by: CJ <lim@chernjie.com>
|
LGTM |
Add extra_hosts to yml configuration --add-hosts
|
Oh this is sweet, and I'm kind of craving this feature right now. Any date set for 1.3.0 release? |
Add extra_hosts to yml configuration
Followup from:
Example:
Signed-off-by: CJ lim@chernjie.com