Add support for swappiness constraint

Run a service using `docker run --memory-swappiness=0` (see
https://docs.docker.com/engine/reference/run/)

refs #2383

Signed-off-by: Jean-François Roche <jfroche@affinitic.be>
This commit is contained in:
Jean-François Roche 2016-06-01 21:15:12 +02:00
commit d824cb9b06
7 changed files with 31 additions and 2 deletions

View file

@ -1271,6 +1271,24 @@ class ConfigTest(unittest.TestCase):
}
]
def test_swappiness_option(self):
actual = config.load(build_config_details({
'version': '2',
'services': {
'web': {
'image': 'alpine',
'mem_swappiness': 10,
}
}
}))
assert actual.services == [
{
'name': 'web',
'image': 'alpine',
'mem_swappiness': 10,
}
]
def test_merge_service_dicts_from_files_with_extends_in_base(self):
base = {
'volumes': ['.:/app'],