Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

down -v doesn't delete anonymous volumes #1755

@BretFisher

Description

@BretFisher

Description

docker compose down -v deletes named volumes but not anonymous ones it creates.

Steps to reproduce the issue:

  1. create a compose file in directory redis:
services:
  redis:
    image: redis:6
  1. Note this image has a VOLUME Dockerfile statement.
  2. Run docker compose up -d to create the network and container.
  3. When container is created, it also creates an anonymous GUID-named volume.
  4. Run docker volume ls to see the anonymous volume listed.
  5. Run docker compose down -v.
  6. Run docker volume ls to see the anonymous volume still listed.

Describe the results you received:

anonymous volumes that are unlisted in the compose file, but controlled by the Dockerfile VOLUME statement, are not deleted when you down -v

Describe the results you expected:

Anonymous volumes are deleted with down -v as the behavior was in docker-compose.

Output of docker compose version:

docker compose version
Docker Compose version 2.0.0-beta.3

Output of docker version:

docker version
Client:
 Cloud integration: 1.0.14
 Version:           20.10.6
 API version:       1.41
 Go version:        go1.16.3
 Git commit:        370c289
 Built:             Fri Apr  9 22:46:57 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.6
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8728dd2
  Built:            Fri Apr  9 22:44:56 2021
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibilityCompatibility with docker-compose

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions