title: Change Docker (snap) data-root folder
body: <p>I'm trying to change the default data folder of docker images, containers, etc to a different path. Snap installation of docker has such folder at <code>/var/snap/docker/common/var-lib-docker</code>.
  Theoretically I could change that with <code>data-root</code> option in <code>deamon.json</code>. But, if I change the <code>daemon.json</code> adding <code>&quot;data-root&quot;: &quot;/home/user/docker&quot;</code> docker won't start due to a conflict with flags (which always has the previously described default path on it).</p>
  <p>I do can start docker with my custom path if I stop it and then start it like this: <code>sudo snap start docker.dockerd --data-root=/home/user/docker</code>. Which is not pretty but works. Is there a way to change docker snap flags on startup or make it prefers the daemon.json options?</p>
  <p>I've read <a href="https://github.com/docker-archive/docker-snap/issues/22" rel="noreferrer">this</a> archived post, which treats such issue on docker version 17, but it didn't helped much the same way several other material I found online. I seems that symbolic link may be a way tho...</p>
  <p>I'm using docker 19.03.11, snap installed on Ubuntu 20.04.</p>
  <p>P.s.: The new path is on a second HDD mounted as my home directory. Changing the path will save space in my system SSD.</p>
  <p>Thanks for the attention.</p>