mirror of
https://github.com/containers/podman-compose.git
synced 2025-06-02 16:36:03 +02:00
add build subcommand and --build arg to compose_run
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
This commit is contained in:
parent
5d279c4948
commit
6b6330c587
@ -2382,6 +2382,15 @@ def compose_run(compose, args):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
compose.commands["up"](compose, up_args)
|
compose.commands["up"](compose, up_args)
|
||||||
|
|
||||||
|
build_args = argparse.Namespace(
|
||||||
|
services=[args.service],
|
||||||
|
if_not_exists=(not args.build),
|
||||||
|
build_arg=[],
|
||||||
|
**args.__dict__
|
||||||
|
)
|
||||||
|
compose.commands["build"](compose, build_args)
|
||||||
|
|
||||||
# adjust one-off container options
|
# adjust one-off container options
|
||||||
name0 = "{}_{}_tmp{}".format(
|
name0 = "{}_{}_tmp{}".format(
|
||||||
compose.project_name, args.service, random.randrange(0, 65536)
|
compose.project_name, args.service, random.randrange(0, 65536)
|
||||||
@ -2751,6 +2760,9 @@ def compose_down_parse(parser):
|
|||||||
|
|
||||||
@cmd_parse(podman_compose, "run")
|
@cmd_parse(podman_compose, "run")
|
||||||
def compose_run_parse(parser):
|
def compose_run_parse(parser):
|
||||||
|
parser.add_argument(
|
||||||
|
"--build", action="store_true", help="Build images before starting containers."
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-d",
|
"-d",
|
||||||
"--detach",
|
"--detach",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user