Check for target property when building images

For multi-stage builds, this allows picking a stage to build up to
This commit is contained in:
Matt Novenstern 2020-04-06 20:14:55 -04:00 committed by Muayyad Alsadi
parent 19733407b4
commit f9915c47b4

View File

@ -1074,6 +1074,9 @@ def build_one(compose, args, cnt):
for build_arg in args_list + args.build_arg:
build_args.extend(("--build-arg", build_arg,))
build_args.append(ctx)
build_target = build_desc.get('target')
if build_target:
build_args.extend(('--target', build_target))
compose.podman.run(build_args, sleep=0)
@cmd_run(podman_compose, 'build', 'build stack images')