Merge pull request #1017 from docker/down_remove_stopped

Remove stopped containers on `down`
This commit is contained in:
Nicolas De loof 2020-12-07 12:18:35 +01:00 committed by GitHub
commit 32efa581f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -502,6 +502,7 @@ func (s *composeService) Down(ctx context.Context, projectName string) error {
func (s *composeService) removeContainers(ctx context.Context, w progress.Writer, eg *errgroup.Group, filter filters.Args) error { func (s *composeService) removeContainers(ctx context.Context, w progress.Writer, eg *errgroup.Group, filter filters.Args) error {
containers, err := s.apiClient.ContainerList(ctx, moby.ContainerListOptions{ containers, err := s.apiClient.ContainerList(ctx, moby.ContainerListOptions{
Filters: filter, Filters: filter,
All: true,
}) })
if err != nil { if err != nil {
return err return err
@ -533,6 +534,7 @@ func (s *composeService) projectFromContainerLabels(ctx context.Context, project
Filters: filters.NewArgs( Filters: filters.NewArgs(
projectFilter(projectName), projectFilter(projectName),
), ),
All: true,
}) })
if err != nil { if err != nil {
return nil, err return nil, err