From 3f387e4e75870a799896ea7330e472d0cda0ec3b Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 15 Feb 2021 10:02:56 +0100 Subject: [PATCH] introduce create --force-recreate and --no-recreate Signed-off-by: Nicolas De Loof --- cli/cmd/compose/create.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/cmd/compose/create.go b/cli/cmd/compose/create.go index 946963038..4380c6bf8 100644 --- a/cli/cmd/compose/create.go +++ b/cli/cmd/compose/create.go @@ -22,6 +22,8 @@ import ( type createOptions struct { *composeOptions + forceRecreate bool + noRecreate bool } func createCommand(p *projectOptions) *cobra.Command { @@ -37,11 +39,15 @@ func createCommand(p *projectOptions) *cobra.Command { projectOptions: p, Build: opts.Build, }, - noStart: true, + noStart: true, + forceRecreate: opts.forceRecreate, + noRecreate: opts.noRecreate, }, args) }, } flags := cmd.Flags() flags.BoolVar(&opts.Build, "build", false, "Build images before starting containers.") + flags.BoolVar(&opts.forceRecreate, "force-recreate", false, "Recreate containers even if their configuration and image haven't changed.") + flags.BoolVar(&opts.noRecreate, "no-recreate", false, "If containers already exist, don't recreate them. Incompatible with --force-recreate.") return cmd }