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
1 changed files with 2 additions and 0 deletions

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 {
containers, err := s.apiClient.ContainerList(ctx, moby.ContainerListOptions{
Filters: filter,
All: true,
})
if err != nil {
return err
@ -533,6 +534,7 @@ func (s *composeService) projectFromContainerLabels(ctx context.Context, project
Filters: filters.NewArgs(
projectFilter(projectName),
),
All: true,
})
if err != nil {
return nil, err