mirror of https://github.com/docker/compose.git
introduce create --force-recreate and --no-recreate
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
a69aa3d98a
commit
3f387e4e75
|
@ -22,6 +22,8 @@ import (
|
||||||
|
|
||||||
type createOptions struct {
|
type createOptions struct {
|
||||||
*composeOptions
|
*composeOptions
|
||||||
|
forceRecreate bool
|
||||||
|
noRecreate bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func createCommand(p *projectOptions) *cobra.Command {
|
func createCommand(p *projectOptions) *cobra.Command {
|
||||||
|
@ -38,10 +40,14 @@ func createCommand(p *projectOptions) *cobra.Command {
|
||||||
Build: opts.Build,
|
Build: opts.Build,
|
||||||
},
|
},
|
||||||
noStart: true,
|
noStart: true,
|
||||||
|
forceRecreate: opts.forceRecreate,
|
||||||
|
noRecreate: opts.noRecreate,
|
||||||
}, args)
|
}, args)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
flags := cmd.Flags()
|
flags := cmd.Flags()
|
||||||
flags.BoolVar(&opts.Build, "build", false, "Build images before starting containers.")
|
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
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue