mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
introduce --renew-anon-volumes
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
dd843bded8
commit
7c4c534b36
4 changed files with 17 additions and 7 deletions
|
|
@ -65,6 +65,7 @@ type upOptions struct {
|
|||
timeChanged bool
|
||||
timeout int
|
||||
noDeps bool
|
||||
noInherit bool
|
||||
}
|
||||
|
||||
func (o upOptions) recreateStrategy() string {
|
||||
|
|
@ -129,6 +130,7 @@ func upCommand(p *projectOptions, contextType string) *cobra.Command {
|
|||
flags.StringVar(&opts.exitCodeFrom, "exit-code-from", "", "Return the exit code of the selected service container. Implies --abort-on-container-exit")
|
||||
flags.IntVarP(&opts.timeout, "timeout", "t", 10, "Use this timeout in seconds for container shutdown when attached or when containers are already running.")
|
||||
flags.BoolVar(&opts.noDeps, "no-deps", false, "Don't start linked services.")
|
||||
flags.BoolVarP(&opts.noInherit, "renew-anon-volumes", "V", false, "Recreate anonymous volumes instead of retrieving data from the previous containers.")
|
||||
}
|
||||
|
||||
return upCmd
|
||||
|
|
@ -192,6 +194,7 @@ func runCreateStart(ctx context.Context, opts upOptions, services []string) erro
|
|||
err := c.ComposeService().Create(ctx, project, compose.CreateOptions{
|
||||
RemoveOrphans: opts.removeOrphans,
|
||||
Recreate: opts.recreateStrategy(),
|
||||
Inherit: !opts.noInherit,
|
||||
})
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue