Skip to content

Commit

Permalink
Merge pull request containerd#3263 from midnight-wonderer/bug/compose…
Browse files Browse the repository at this point in the history
…-stop-before-down

gracefully terminate containers on nerdctl compose down
  • Loading branch information
AkihiroSuda authored Jul 30, 2024
2 parents b030e1d + 915106f commit bd0128b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/composer/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func (c *Composer) Down(ctx context.Context, downOptions DownOptions) error {
if err != nil {
return err
}
// use default Options to stop service containers.
if err := c.stopContainers(ctx, containers, StopOptions{}); err != nil {
return err
}
if err := c.removeContainers(ctx, containers, RemoveOptions{Stop: true, Volumes: downOptions.RemoveVolumes}); err != nil {
return err
}
Expand Down

0 comments on commit bd0128b

Please sign in to comment.