mirror of https://github.com/docker/compose.git
Merge pull request #1331 from xuxinkun/cpuset20150424
Add cpuset config.
This commit is contained in:
commit
9532e5a4f2
|
@ -7,6 +7,7 @@ DOCKER_CONFIG_KEYS = [
|
||||||
'cap_add',
|
'cap_add',
|
||||||
'cap_drop',
|
'cap_drop',
|
||||||
'cpu_shares',
|
'cpu_shares',
|
||||||
|
'cpuset',
|
||||||
'command',
|
'command',
|
||||||
'detach',
|
'detach',
|
||||||
'dns',
|
'dns',
|
||||||
|
|
|
@ -310,13 +310,14 @@ dns_search:
|
||||||
- dc2.example.com
|
- dc2.example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
### working\_dir, entrypoint, user, hostname, domainname, mem\_limit, privileged, restart, stdin\_open, tty, cpu\_shares
|
### working\_dir, entrypoint, user, hostname, domainname, mem\_limit, privileged, restart, stdin\_open, tty, cpu\_shares, cpuset
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
```
|
```
|
||||||
cpu_shares: 73
|
cpu_shares: 73
|
||||||
|
cpuset: 0,1
|
||||||
|
|
||||||
working_dir: /code
|
working_dir: /code
|
||||||
entrypoint: /code/entrypoint.sh
|
entrypoint: /code/entrypoint.sh
|
||||||
|
|
|
@ -167,6 +167,12 @@ class ServiceTest(DockerClientTestCase):
|
||||||
service.start_container(container)
|
service.start_container(container)
|
||||||
self.assertEqual(set(container.get('HostConfig.ExtraHosts')), set(extra_hosts_list))
|
self.assertEqual(set(container.get('HostConfig.ExtraHosts')), set(extra_hosts_list))
|
||||||
|
|
||||||
|
def test_create_container_with_cpu_set(self):
|
||||||
|
service = self.create_service('db', cpuset='0')
|
||||||
|
container = service.create_container()
|
||||||
|
service.start_container(container)
|
||||||
|
self.assertEqual(container.inspect()['Config']['Cpuset'], '0')
|
||||||
|
|
||||||
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