|
@@ -120,6 +120,11 @@ func upCommand(p *projectOptions, backend api.Service) *cobra.Command {
|
|
|
return nil
|
|
|
}),
|
|
|
RunE: p.WithServices(func(ctx context.Context, project *types.Project, services []string) error {
|
|
|
+ ignore := project.Environment["COMPOSE_IGNORE_ORPHANS"]
|
|
|
+ create.ignoreOrphans = strings.ToLower(ignore) == "true"
|
|
|
+ if create.ignoreOrphans && create.removeOrphans {
|
|
|
+ return fmt.Errorf("COMPOSE_IGNORE_ORPHANS and --remove-orphans cannot be combined")
|
|
|
+ }
|
|
|
return runUp(ctx, backend, create, up, project, services)
|
|
|
}),
|
|
|
ValidArgsFunction: serviceCompletion(p),
|
|
@@ -177,6 +182,7 @@ func runUp(ctx context.Context, backend api.Service, createOptions createOptions
|
|
|
create := api.CreateOptions{
|
|
|
Services: services,
|
|
|
RemoveOrphans: createOptions.removeOrphans,
|
|
|
+ IgnoreOrphans: createOptions.ignoreOrphans,
|
|
|
Recreate: createOptions.recreateStrategy(),
|
|
|
RecreateDependencies: createOptions.dependenciesRecreateStrategy(),
|
|
|
Inherit: !createOptions.noInherit,
|