Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5979

How to move /var/lib/docker to another directory? [duplicate]

$
0
0

I think, This problem is very population, I find a lot of ways on internet, but I have tried all of them, nothing can work.

I want to move /var/lib/docker folder because my computer has low disk space.

I perform these steps:

1 Stop daemon

service docker stop

2 Add configuration file with location of new data directory

Create/Edit /etc/docker/daemon.json file:

{"data-root": "/path/to/new/docker/location","storage-driver": "overlay2"}

3 update config /lib/systemd/system/docker.service

xecStart=/usr/bin/dockerd --data-root /path/to/new/docker/location -H fd:// --containerd=/run/containerd/containerd.sock

I also try with -g replace to --data-root, both ways donot work.

4 Copy docker files to new location

rsync -aP /var/lib/docker/ /path/to/new/docker/location

5 Start daemon

service docker start

However, I have a error at step 5, actually I don't know how to fix that.

enter image description here

Anyone can help me?

Update:

Please link the similar question responsibly, it's not work for me, I also describe detail steps that I performed.


Viewing all articles
Browse latest Browse all 5979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>