diff --git a/cmd/compose/create.go b/cmd/compose/create.go index bf21ee7af..1fe05e98d 100644 --- a/cmd/compose/create.go +++ b/cmd/compose/create.go @@ -117,6 +117,9 @@ func (opts createOptions) recreateStrategy() string { if opts.forceRecreate { return api.RecreateForce } + if opts.noInherit { + return api.RecreateForce + } return api.RecreateDiverged } diff --git a/cmd/compose/up.go b/cmd/compose/up.go index 9e94d3736..191eccc25 100644 --- a/cmd/compose/up.go +++ b/cmd/compose/up.go @@ -189,6 +189,9 @@ func validateFlags(up *upOptions, create *createOptions) error { if up.Detach && (up.attachDependencies || up.cascadeStop || up.cascadeFail || len(up.attach) > 0 || up.watch) { return fmt.Errorf("--detach cannot be combined with --abort-on-container-exit, --abort-on-container-failure, --attach, --attach-dependencies or --watch") } + if create.noInherit && create.noRecreate { + return fmt.Errorf("--no-recreate and --renew-anon-volumes are incompatible") + } if create.forceRecreate && create.noRecreate { return fmt.Errorf("--force-recreate and --no-recreate are incompatible") }