mirror of
https://github.com/docker/compose.git
synced 2025-07-25 22:54:54 +02:00
attach _only_ to services declared by project applying profiles
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
7e3564b7ad
commit
8d03e29994
@ -185,6 +185,9 @@ func runUp(ctx context.Context, backend api.Service, createOptions createOptions
|
|||||||
if upOptions.attachDependencies {
|
if upOptions.attachDependencies {
|
||||||
attachTo = project.ServiceNames()
|
attachTo = project.ServiceNames()
|
||||||
}
|
}
|
||||||
|
if len(attachTo) == 0 {
|
||||||
|
attachTo = project.ServiceNames()
|
||||||
|
}
|
||||||
|
|
||||||
create := api.CreateOptions{
|
create := api.CreateOptions{
|
||||||
Services: services,
|
Services: services,
|
||||||
|
@ -61,12 +61,12 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
|
|||||||
go func() {
|
go func() {
|
||||||
<-signalChan
|
<-signalChan
|
||||||
s.Kill(ctx, project.Name, api.KillOptions{ // nolint:errcheck
|
s.Kill(ctx, project.Name, api.KillOptions{ // nolint:errcheck
|
||||||
Services: options.Create.Services,
|
Services: project.ServiceNames(),
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return s.Stop(ctx, project.Name, api.StopOptions{
|
return s.Stop(ctx, project.Name, api.StopOptions{
|
||||||
Services: options.Create.Services,
|
Services: project.ServiceNames(),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user