As recommneded by @mbarthelemy this can be done via the -g
option when starting the docker daemon directly.
However, if docker is being started as a system service, it is not recommended to modify the /etc/default/docker
file. There is a guideline to this located here.
The correct approach is to create an /etc/docker/daemon.json
file on Linux (or Mac) systems or %programdata%\docker\config\daemon.json
on Windows. If this file is not being used for anything else, the following fields should suffice:
{
"graph": "/docker/daemon_files"
}
This is assuming the new location where you want to have docker persist its data is /docker/daemon_files