IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Browse Source

Added --squeeze switch to focker compose build.

master
parent
commit
edca7c0913
2 changed files with 8 additions and 4 deletions
  1. +7
    -4
      focker/compose.py
  2. +1
    -0
      focker/focker.py

+ 7
- 4
focker/compose.py View File

@@ -48,11 +48,14 @@ def build_volumes(spec):
zfs_set_props(name, params['zfs'])
def build_images(spec, path):
def build_images(spec, path, args):
# print('build_images(): NotImplementedError')
for (tag, focker_dir) in spec.items():
res = subprocess.run(['focker', 'image', 'build',
os.path.join(path, focker_dir), '-t', tag])
cmd = ['focker', 'image', 'build',
os.path.join(path, focker_dir), '-t', tag]
if args.squeeze:
cmd.append('--squeeze')
res = subprocess.run(cmd)
if res.returncode != 0:
raise RuntimeError('Image build failed: ' + str(res.returncode))
@@ -97,7 +100,7 @@ def command_compose_build(args):
if 'volumes' in spec:
build_volumes(spec['volumes'])
if 'images' in spec:
build_images(spec['images'], path)
build_images(spec['images'], path, args)
if 'jails' in spec:
build_jails(spec['jails'])


+ 1
- 0
focker/focker.py View File

@@ -192,6 +192,7 @@ def create_parser():
parser = ListForwarder([subparsers.add_parser(cmd) for cmd in ['build', 'bld', 'b']])
parser.set_defaults(func=command_compose_build)
parser.add_argument('filename', type=str)
parser.add_argument('--squeeze', '-s', action='store_true')
parser = ListForwarder([subparsers.add_parser(cmd) for cmd in ['run', 'r']])
parser.set_defaults(func=command_compose_run)


Loading…
Cancel
Save