The stuff I do

Docker move data directory

← Notes

Tags: [docker]

Instructions copied from this site

By default Docker stores its data in /var/lib/docker

To move this data:

  1. sudo service docker stop

  2. Add this to /etc/docker/daemon.json (file might not exist)

    "data-root": "/path/to/your/docker"

  3. sudo rsync -aP /var/lib/docker/ /path/to/your/docker

  4. sudo mv /var/lib/docker /var/lib/docker.old

  5. sudo service docker start

  6. Test

  7. sudo rm -rf /var/lib/docker.old

← Notes

Back to top