dockerdocker-composedocker-volumemount-point

Change default volume mount point for docker rootless?


I saw this post with different solutions for standard docker installation: How to change the default location for "docker create volume" command?

At first glance I struggle to repeat the steps to change the default mount point for the rootless installation. Should it be the same? What would be the procedure?


Solution

  • I just got it working. I had some issues because I had the service running while trying to change configurations. Key takeaways:

    1. The config file is indeed stored in ~/.config/docker/. One must make a daemon.json file here in order to change preferences. We would like to change the data-root option (and storage-driver, in case the drive does not have capabilities

    2. To start and stop the headless service one runs systemctl --user [start | stop] docker.

      a. Running the systemwide service starts a parallel and separate instance of docker, which is not rootless.

      b. When stopping make sure to stop the docker.socketfirst.

    Sources are (see Useage section for rootless) and (config file information)