Unable to remove a directory of out the Docker root #33800
Due to poor default partitioning scheme, I am forced to store the Docker volumes in a different directory and add a symbolic link to it from
> ls -l /var/lib/docker ... rwxrwxrwx. 1 root root 13 Sep 29 2016 volumes -> /home/volumes
This works fine, except when I want to remove volumes. I get:
Error response from daemon: unable to remove volume: remove 06a9724d58196f4657e5f546dd08f62797bfef71699c5129984f09604f067812: Unable to remove a directory of out the Docker root /var/lib/docker: /home/volumes/06a9724d58196f4657e5f546dd08f62797bfef71699c5129984f09604f067812/_data
The workaround is to go a manually remove the
Describe the results you expected:
I would expect Docker to be more consistent. If it can create directories and files outside the root, how come it cannot delete them.
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered:
Here's the offending code: https://github.com/moby/moby/blob/master/volume/local/local.go#L236
Probably the best option is to provide a way to configure the data root for the local volume driver.
I have this issue as well, and unlike OP just using bind mounts instead is not a solution for me. I believe that there should be a way for docker to be able to clean up volumes even if /var/lib/docker/volumes is symlinked to another directory (which might be, say, on a larger disk than /var since a docker volume could store large amounts of data better suited to a mass storage disk than the O/S drive of a system).
Is there any chance of this being looked at for a fix?