Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ dns_search:

### devices

List of device mappings. Uses the same format as the `--device` docker
List of device mappings. Uses the same format as the `--device` docker
client create option.

```
Expand Down Expand Up @@ -388,3 +388,13 @@ read_only: true
- [Command line reference](cli.md)
- [Compose environment variables](env.md)
- [Compose command line completion](completion.md)


### extra_hosts

Add custom entry in /etc/hosts file.

```
extra_hosts:
mymemcacheserver: 192.168.0.10
```
9 changes: 9 additions & 0 deletions tests/integration/service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ def test_create_container_with_volumes_from(self):
self.assertIn(volume_container_2.id,
host_container.get('HostConfig.VolumesFrom'))

def test_create_container_with_extra_hosts(self):
extra_hosts = {'myserver': '192.168.2.90',
'myserver2': '10.55.32.12'}
service = self.create_service('database', extra_hosts=extra_hosts)
container = service.create_container()
service.start_container(container)
self.assertEqual(container.get('HostConfig.ExtraHosts'),
['myserver:192.168.2.90', 'myserver2:10.55.32.12'])

def test_recreate_containers(self):
service = self.create_service(
'db',
Expand Down