Docker changing /var/lib/docker/aufs/diff location Docker changing /var/lib/docker/aufs/diff location docker docker

Docker changing /var/lib/docker/aufs/diff location


There's an easy way to get the docker daemon to handle this for you.

stop docker

$ service docker stop

add this line to /etc/default/docker

# Use DOCKER_OPTS to modify the daemon startup options.DOCKER_OPTS="-g /<new destination>/docker/"

start docker

$ service docker start

verify the docker files and folders are created in the new destination

remove /var/lib/docker

/var/lib$ sudo rm -rf docker


There is an answer on this thread, basically a ln -s, after some preparatory work

docker ps -q | xargs docker killstop dockercd /var/lib/docker/devicemapper/mntumount ./*mv /var/lib/docker $destln -s $dest /var/lib/dockerstart docker

https://github.com/docker/docker/issues/3127#issuecomment-30095645