Why make Docker use your server’s disk when you can use cheap effective Block Storage!
Find the disk you want using
df -h
root@docker-ubuntu-s-8vcpu-16gb-amd-nyc3-01:/mnt/volume_nyc3_01# df -h Filesystem Size Used Avail Use% Mounted on udev 7.8G 0 7.8G 0% /dev tmpfs 1.6G 1.0M 1.6G 1% /run /dev/vda1 310G 8.1G 302G 3% / tmpfs 7.9G 0 7.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup /dev/vda15 105M 9.2M 96M 9% /boot/efi /dev/sda 992G 77M 942G 1% /mnt/volume_nyc3_01 <---BLOCK---< /dev/loop1 31M 31M 0 100% /snap/snapd/9607 /dev/loop0 56M 56M 0 100% /snap/core18/1885 /dev/loop2 71M 71M 0 100% /snap/lxd/16922 /dev/loop3 33M 33M 0 100% /snap/snapd/11107 /dev/loop4 56M 56M 0 100% /snap/core18/1988 /dev/loop5 70M 70M 0 100% /snap/lxd/19188 tmpfs 1.6G 0 1.6G 0% /run/user/0
Then use the mount point below:
LARGE_VOLUME=mnt/volume_nyc3_01 killall dockerd systemctl disable --now docker systemctl disable --now docker.socket systemctl stop docker systemctl stop docker.socket # rm -rf /var/lib/docker sudo dockerd & sleep 5 killall dockerd mv /var/lib/docker "${LARGE_VOLUME}" ln -s "${LARGE_VOLUME}" /var/lib/docker
How to start all the services? can you add code for that.
Turn off Docker first
I use `sudo dockerd` from the command line
systemctl disable –now docker
systemctl disable –now docker.socket
systemctl stop docker
systemctl stop docker.socket
I prefer to use
“`
sudo dockerd
“`
in a terminal
OR you can do: `systemctl enable –now docker`
And if your docker folder gets really really big, you can always nuke it:
“`
rm -rf /var/lib/docker/*
“`
I usually use thunar to delete just to make sure, like:
“`
sudo thunar /var/lib/docker/
# and then highlight and delete the folders as root
“`
Turn Docker off when you’re moving stuff or deleting anything