Skip to content

Commit

Permalink
Added support to option mac-address
Browse files Browse the repository at this point in the history
Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Updated doc

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Fixed LINT errors

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Changed mac-address entry order in config keys

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>

Changed attributes order in docs/yml.md

Signed-off-by: Sébastien Gruchet <gruchet@gmail.com>
  • Loading branch information
calou committed Jun 17, 2015
1 parent 417e6ce commit b76ac6e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions compose/config.py
Expand Up @@ -23,6 +23,7 @@
'image',
'labels',
'links',
'mac_address',
'mem_limit',
'net',
'log_driver',
Expand Down
5 changes: 4 additions & 1 deletion docs/yml.md
Expand Up @@ -362,7 +362,7 @@ security_opt:
- label:role:ROLE
```

### working\_dir, entrypoint, user, hostname, domainname, mem\_limit, privileged, restart, stdin\_open, tty, cpu\_shares, cpuset, read\_only
### working\_dir, entrypoint, user, hostname, domainname, mac\_address, mem\_limit, privileged, restart, stdin\_open, tty, cpu\_shares, cpuset, read\_only

Each of these is a single value, analogous to its
[docker run](https://docs.docker.com/reference/run/) counterpart.
Expand All @@ -378,6 +378,8 @@ user: postgresql
hostname: foo
domainname: foo.com
mac_address: 02:42:ac:11:65:43
mem_limit: 1000000000
privileged: true
Expand All @@ -386,6 +388,7 @@ restart: always
stdin_open: true
tty: true
read_only: true
```

## Compose documentation
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/service_test.py
Expand Up @@ -198,6 +198,12 @@ def test_create_container_with_security_opt(self):
service.start_container(container)
self.assertEqual(set(container.get('HostConfig.SecurityOpt')), set(security_opt))

def test_create_container_with_mac_address(self):
service = self.create_service('db', mac_address='02:42:ac:11:65:43')
container = service.create_container()
service.start_container(container)
self.assertEqual(container.inspect()['Config']['MacAddress'], '02:42:ac:11:65:43')

def test_create_container_with_specified_volume(self):
host_path = '/tmp/host-path'
container_path = '/container-path'
Expand Down

0 comments on commit b76ac6e

Please sign in to comment.