Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit ba4c785

Browse files
authored
Merge pull request #1680 from ndeloof/start_services
only start current project services
2 parents 0a02f7d + 377bcd8 commit ba4c785

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cli/cmd/compose/up.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ func runCreateStart(ctx context.Context, backend compose.Service, opts upOptions
254254
return "", err
255255
}
256256
if opts.Detach {
257-
err = backend.Start(ctx, project, compose.StartOptions{})
257+
err = backend.Start(ctx, project, compose.StartOptions{
258+
Services: services,
259+
})
258260
}
259261
return "", err
260262
})

local/compose/attach.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ import (
3333
)
3434

3535
func (s *composeService) attach(ctx context.Context, project *types.Project, listener compose.ContainerEventListener, selectedServices []string) (Containers, error) {
36+
if len(selectedServices) == 0 {
37+
selectedServices = project.ServiceNames()
38+
}
39+
3640
containers, err := s.getContainers(ctx, project.Name, oneOffExclude, true, selectedServices...)
3741
if err != nil {
3842
return nil, err

0 commit comments

Comments
 (0)