mirror of
https://github.com/docker/compose.git
synced 2025-07-06 13:24:25 +02:00
Merge pull request #1680 from ndeloof/start_services
only start current project services
This commit is contained in:
commit
ba4c7858c9
@ -254,7 +254,9 @@ func runCreateStart(ctx context.Context, backend compose.Service, opts upOptions
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
if opts.Detach {
|
if opts.Detach {
|
||||||
err = backend.Start(ctx, project, compose.StartOptions{})
|
err = backend.Start(ctx, project, compose.StartOptions{
|
||||||
|
Services: services,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return "", err
|
return "", err
|
||||||
})
|
})
|
||||||
|
@ -33,6 +33,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (s *composeService) attach(ctx context.Context, project *types.Project, listener compose.ContainerEventListener, selectedServices []string) (Containers, error) {
|
func (s *composeService) attach(ctx context.Context, project *types.Project, listener compose.ContainerEventListener, selectedServices []string) (Containers, error) {
|
||||||
|
if len(selectedServices) == 0 {
|
||||||
|
selectedServices = project.ServiceNames()
|
||||||
|
}
|
||||||
|
|
||||||
containers, err := s.getContainers(ctx, project.Name, oneOffExclude, true, selectedServices...)
|
containers, err := s.getContainers(ctx, project.Name, oneOffExclude, true, selectedServices...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user