d-utils

simple utils to use docker images without docker
git clone https://git.ce9e.org/d-utils.git

commit
8e8e6ba9a7ef41e7d4da62e0fac039fd081d3455
parent
1c55b15bdf2c195148794b7b20bca81c0e63aa29
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-04-28 11:10
fix volumes with read-only rootfs

see https://github.com/containers/bubblewrap/issues/413

Diffstat

M d-run 8 ++++----

1 files changed, 4 insertions, 4 deletions


diff --git a/d-run b/d-run

@@ -28,7 +28,7 @@ def make_volume(path, dir):
   28    28 def build_cmd(dir, config):
   29    29 	cmd = [
   30    30 		'bwrap',
   31    -1 		'--ro-bind', os.path.join(dir, 'rootfs'), '/',
   -1    31 		'--bind', os.path.join(dir, 'rootfs'), '/',
   32    32 		'--tmpfs', '/tmp',
   33    33 		'--dev', '/dev',
   34    34 		'--proc', '/proc',
@@ -37,9 +37,6 @@ def build_cmd(dir, config):
   37    37 		'--die-with-parent',
   38    38 	]
   39    39 
   40    -1 	if config.get('rw'):
   41    -1 		cmd[1] = '--bind'
   42    -1 
   43    40 	if config.get('Hostname'):
   44    41 		cmd += ['--hostname', config['Hostname']]
   45    42 	if config.get('WorkingDir'):
@@ -53,6 +50,9 @@ def build_cmd(dir, config):
   53    50 		for volume in config['Volumes']:
   54    51 			cmd += make_volume(volume, dir)
   55    52 
   -1    53 	if not config.get('rw'):
   -1    54 		cmd += ['--remount-ro', '/']
   -1    55 
   56    56 	if config.get('net'):
   57    57 		cmd += [
   58    58 			'--ro-bind', '/etc/resolv.conf', '/etc/resolv.conf',