Skip to content

Commit 9cae9eb

Browse files
authored
Merge pull request docker#9488 from ndeloof/attach_profiles
attach _only_ to services declared by project applying profiles
2 parents 7ee7bec + 8d03e29 commit 9cae9eb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmd/compose/up.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ func runUp(ctx context.Context, backend api.Service, createOptions createOptions
185185
if upOptions.attachDependencies {
186186
attachTo = project.ServiceNames()
187187
}
188+
if len(attachTo) == 0 {
189+
attachTo = project.ServiceNames()
190+
}
188191

189192
create := api.CreateOptions{
190193
Services: services,

pkg/compose/up.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
6161
go func() {
6262
<-signalChan
6363
s.Kill(ctx, project.Name, api.KillOptions{ // nolint:errcheck
64-
Services: options.Create.Services,
64+
Services: project.ServiceNames(),
6565
})
6666
}()
6767

6868
return s.Stop(ctx, project.Name, api.StopOptions{
69-
Services: options.Create.Services,
69+
Services: project.ServiceNames(),
7070
})
7171
})
7272
}

0 commit comments

Comments
 (0)