Reputation: 1050
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?
Upvotes: 2
Views: 1153
Reputation: 173
I just got it working. I had some issues because I had the service running while trying to change configurations. Key takeaways:
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
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.socket
first.
Sources are (see Useage section for rootless) and (config file information)
Upvotes: 1
Reputation: 1050
We ended up with the indirect solution. We have identified the directory where the volumes are mounted by default and created a symbolic link which points to the place where we actually want to store the data. In our case it was enough. Something like that:
sudo ln -s /data /home/ubuntu/.local/share/docker/volumes"
Upvotes: 2