diff --git a/compose/service.py b/compose/service.py index e5a4cc4a0..8d40ab10c 100644 --- a/compose/service.py +++ b/compose/service.py @@ -502,7 +502,9 @@ class Service(object): 'image_id': self.image()['Id'], 'links': self.get_link_names(), 'net': self.net.id, - 'volumes_from': self.get_volumes_from_names(), + 'volumes_from': [ + (v.source.name, v.mode) for v in self.volumes_from if isinstance(v.source, Service) + ], } def get_dependency_names(self): diff --git a/tests/unit/service_test.py b/tests/unit/service_test.py index 8c5c888fa..bd7712250 100644 --- a/tests/unit/service_test.py +++ b/tests/unit/service_test.py @@ -410,7 +410,7 @@ class ServiceTest(unittest.TestCase): 'options': {'image': 'example.com/foo'}, 'links': [('one', 'one')], 'net': 'other', - 'volumes_from': ['two'], + 'volumes_from': [('two', 'rw')], } self.assertEqual(config_dict, expected)