Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cmd/nerdctl/container/container_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@ func runAction(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}

statusC, err := task.Wait(ctx)
if err != nil {
return err
}

if err := task.Start(ctx); err != nil {
return err
}
Expand All @@ -454,10 +460,6 @@ func runAction(cmd *cobra.Command, args []string) error {
}
}

statusC, err := task.Wait(ctx)
if err != nil {
return err
}
select {
// io.Wait() would return when either 1) the user detaches from the container OR 2) the container is about to exit.
//
Expand Down
10 changes: 4 additions & 6 deletions pkg/containerutil/containerutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ func Start(ctx context.Context, container containerd.Container, isAttach bool, i
if err != nil {
return err
}

statusC, err := task.Wait(ctx)
if err != nil {
return err
}
if err := task.Start(ctx); err != nil {
return err
}
Expand All @@ -293,11 +296,6 @@ func Start(ctx context.Context, container containerd.Container, isAttach bool, i
}
sigc := signalutil.ForwardAllSignals(ctx, task)
defer signalutil.StopCatch(sigc)

statusC, err := task.Wait(ctx)
if err != nil {
return err
}
select {
// io.Wait() would return when either 1) the user detaches from the container OR 2) the container is about to exit.
//
Expand Down
Loading