Add extra_hosts to yml configuration --add-hosts#1158
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.
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 <[email protected]>
|
@aanand Updated with |
|
Fantastic. Could you squash and rebase? Thanks. |
Added unit tests in build_extra_hosts + fix Signed-off-by: CJ <[email protected]>
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 <[email protected]>
|
@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.
maybe 'extra_host': 'extra_hosts', as well ?
|
I like this, I think it addresses the "external" type described in #988 LGTM |
Signed-off-by: CJ <[email protected]>
|
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 [email protected]