drosofff
6/13/2016 - 12:23 PM

From https://forums.docker.com/t/how-do-i-change-the-docker-image-installation-directory/1169

You can change Docker's storage base directory (where container and images go) using the -g option when starting the Docker daemon.

Ubuntu/Debian

  • service docker stop
  • Edit your /etc/default/docker file with the -g option:
# DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4"
DOCKER_OPTS="-g /mnt"
  • service docker start

This is also another option, depending on the way docker is managed

https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux