mirror of https://github.com/docker/compose.git
Merge pull request #1142 from calou/master
Added support of option mac-address
This commit is contained in:
commit
77c939b256
|
@ -23,6 +23,7 @@ DOCKER_CONFIG_KEYS = [
|
||||||
'image',
|
'image',
|
||||||
'labels',
|
'labels',
|
||||||
'links',
|
'links',
|
||||||
|
'mac_address',
|
||||||
'mem_limit',
|
'mem_limit',
|
||||||
'net',
|
'net',
|
||||||
'log_driver',
|
'log_driver',
|
||||||
|
|
|
@ -365,7 +365,7 @@ security_opt:
|
||||||
- label:role:ROLE
|
- 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
|
Each of these is a single value, analogous to its
|
||||||
[docker run](https://docs.docker.com/reference/run/) counterpart.
|
[docker run](https://docs.docker.com/reference/run/) counterpart.
|
||||||
|
@ -381,6 +381,8 @@ user: postgresql
|
||||||
hostname: foo
|
hostname: foo
|
||||||
domainname: foo.com
|
domainname: foo.com
|
||||||
|
|
||||||
|
mac_address: 02:42:ac:11:65:43
|
||||||
|
|
||||||
mem_limit: 1000000000
|
mem_limit: 1000000000
|
||||||
privileged: true
|
privileged: true
|
||||||
|
|
||||||
|
@ -389,6 +391,7 @@ restart: always
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
read_only: true
|
read_only: true
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Compose documentation
|
## Compose documentation
|
||||||
|
|
|
@ -199,6 +199,12 @@ class ServiceTest(DockerClientTestCase):
|
||||||
service.start_container(container)
|
service.start_container(container)
|
||||||
self.assertEqual(set(container.get('HostConfig.SecurityOpt')), set(security_opt))
|
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):
|
def test_create_container_with_specified_volume(self):
|
||||||
host_path = '/tmp/host-path'
|
host_path = '/tmp/host-path'
|
||||||
container_path = '/container-path'
|
container_path = '/container-path'
|
||||||
|
|
Loading…
Reference in New Issue