docker

Docker: Error response from daemon: remove myvol: volume is in use


When I'm trying to remove a volume I get this error:

Error response from daemon: remove myvol: volume is in use - [2a177cb40a405db9f245fccd776dcdeacc d266ad624daf7cff510c9a1a1716fe]

But both docker ps and docker container ls return an empty list.

I've tried restarting the docker daemon.

I use Docker Toolbox on Windows 10.


Solution

  • try to delete all stopped containers:

    docker rm -f $(docker ps -a -q)
    

    then delete the volume

    you can see stopped container using docker ps -a using docker ps will return only running containers

    EDIT since you are on Windows

    list stopped containers:

    docker ps -a
    

    delete the stopped container - you need to replace CONTAINER_ID with your real ones -:

    docker rm -f CONTAINER_ID_1 CONTAINER_ID_2