create this file: /etc/docker/daemon.json
and in it, put:
{ "data-root": "/your/new/location" }
and restart docker, NOTE that your running containers and images will still excist in the old directory, so if you have any of these, and change data-root, your installation will be “clean”, so consider moving the data to the new location, if you have any data in the current placement of docker