Add support for docker run --tmpfs flag.

Signed-off-by: Philip Walls <pawalls@rabidgeek.com>
This commit is contained in:
Philip Walls 2016-02-20 01:18:40 +00:00 committed by Daniel Nephin
commit 85c7d3e5ce
9 changed files with 37 additions and 5 deletions

View file

@ -875,6 +875,11 @@ class ServiceTest(DockerClientTestCase):
container = create_and_start_container(service)
self.assertEqual(container.get('HostConfig.DnsSearch'), ['dc1.example.com', 'dc2.example.com'])
def test_tmpfs(self):
service = self.create_service('web', tmpfs=['/run'])
container = create_and_start_container(service)
self.assertEqual(container.get('HostConfig.Tmpfs'), {'/run': ''})
def test_working_dir_param(self):
service = self.create_service('container', working_dir='/working/dir/sample')
container = service.create_container()

View file

@ -1194,6 +1194,21 @@ class ConfigTest(unittest.TestCase):
}
]
def test_tmpfs_option(self):
actual = config.load(build_config_details({
'web': {
'image': 'alpine',
'tmpfs': '/run',
}
}))
assert actual.services == [
{
'name': 'web',
'image': 'alpine',
'tmpfs': ['/run'],
}
]
def test_merge_service_dicts_from_files_with_extends_in_base(self):
base = {
'volumes': ['.:/app'],