Allow setting mode on volumes
This commit is contained in:
parent
ac7237faa8
commit
756da55018
|
@ -44,14 +44,14 @@ class Container:
|
||||||
return self.get_config('Env', default=[])
|
return self.get_config('Env', default=[])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def volumes(self):
|
def volumes(self, mode='rw'):
|
||||||
"""
|
"""
|
||||||
Return volumes for the container in the following format:
|
Return volumes for the container in the following format:
|
||||||
{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},}
|
{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},}
|
||||||
"""
|
"""
|
||||||
volumes = {}
|
volumes = {}
|
||||||
for mount in self._mounts:
|
for mount in self._mounts:
|
||||||
volumes[mount.source] = {'bind': mount.destination, 'mode': 'ro'}
|
volumes[mount.source] = {'bind': mount.destination, 'mode': mode}
|
||||||
|
|
||||||
return volumes
|
return volumes
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue