@@ -28,8 +28,10 @@ import (
2828 "github.com/containerd/errdefs"
2929
3030 "github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
31+ "github.com/containerd/nerdctl/v2/pkg/api/types"
3132 "github.com/containerd/nerdctl/v2/pkg/clientutil"
3233 "github.com/containerd/nerdctl/v2/pkg/cmd/compose"
34+ "github.com/containerd/nerdctl/v2/pkg/config"
3335 "github.com/containerd/nerdctl/v2/pkg/containerutil"
3436 "github.com/containerd/nerdctl/v2/pkg/labels"
3537)
@@ -86,15 +88,15 @@ func startAction(cmd *cobra.Command, args []string) error {
8688 return fmt .Errorf ("service %q has no container to start" , svcName )
8789 }
8890
89- if err := startContainers (ctx , client , containers ); err != nil {
91+ if err := startContainers (ctx , client , containers , & globalOptions ); err != nil {
9092 return err
9193 }
9294 }
9395
9496 return nil
9597}
9698
97- func startContainers (ctx context.Context , client * containerd.Client , containers []containerd.Container ) error {
99+ func startContainers (ctx context.Context , client * containerd.Client , containers []containerd.Container , globalOptions * types. GlobalCommandOptions ) error {
98100 eg , ctx := errgroup .WithContext (ctx )
99101 for _ , c := range containers {
100102 c := c
@@ -112,7 +114,7 @@ func startContainers(ctx context.Context, client *containerd.Client, containers
112114 }
113115
114116 // in compose, always disable attach
115- if err := containerutil .Start (ctx , c , false , false , client , "" ); err != nil {
117+ if err := containerutil .Start (ctx , c , false , false , client , "" , ( * config . Config )( globalOptions ) ); err != nil {
116118 return err
117119 }
118120 info , err := c .Info (ctx , containerd .WithoutRefreshedMetadata )
0 commit comments