Remove extra s from --add-host

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>
This commit is contained in:
CJ 2015-03-24 18:25:09 +08:00
commit 25ee3f0033
3 changed files with 65 additions and 37 deletions

View file

@ -89,19 +89,19 @@ external_links:
### extra_hosts
Add hostname mappings. Use the same values as the docker client `--add-hosts` parameter.
Add hostname mappings. Use the same values as the docker client `--add-host` parameter.
```
extra_hosts:
- docker: 162.242.195.82
- fig: 50.31.209.229
- "somehost:162.242.195.82"
- "otherhost:50.31.209.229"
```
An entry with the ip address and hostname will be created in `/etc/hosts` inside containers for this service, e.g:
```
162.242.195.82 docker
50.31.209.229 fig
162.242.195.82 somehost
50.31.209.229 otherhost
```
### ports