Merge pull request #1163 from docker/stop-on-ctrlc

Stop project on Ctrl+C
This commit is contained in:
Guillaume Tardif 2021-01-26 17:08:32 +01:00 committed by GitHub
commit 3f474143ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 102 additions and 12 deletions

View file

@ -117,7 +117,7 @@ func runCreateStart(ctx context.Context, opts upOptions, services []string) erro
fmt.Println("Gracefully stopping...")
ctx = context.Background()
_, err = progress.Run(ctx, func(ctx context.Context) (string, error) {
return "", c.ComposeService().Down(ctx, project.Name, compose.DownOptions{})
return "", c.ComposeService().Stop(ctx, project, consumer)
})
}
return err