Skip to main content

Change Docker storage location

p0nch0 d3v

Stop docker service and socket

sudo systemctl stop docker.service && \
sudo systemctl stop docker.socket

Edit the current configuration

sudo nano /lib/systemd/system/docker.service

Locate: ExecStart

and add the follwing line: -g /some/other/location

Ensure that the directory exits

sudo mkdir -p /some/other/location

Sync pre-existing content

sudo rsync -aqxP /var/lib/docker/ /some/other/location

Start docker service and socket

sudo systemctl daemon-reload && \
sudo systemctl start docker