Docker
|
Change the directory where Docker store its persisted data (volumes, images, ...) (Ubuntu)
By default, Docker store its persisted data
(local volumes, containers, filesystem data for images, configuration for resources, swarm cluster state)
in /var/lib/docker directory.
To change this location to a new one, edit the file /lib/systemd/system/docker.service and adjust the entry ExecStart.
First, stop Docker service:
Adjust /lib/systemd/system/docker.service:
[Optional] You can copy all your existing Docker data (default location: /var/lib/docker) to the new location (/opt/docker):
Reload systemd manager configuration:
Start Docker service:
Check the new location: