How to move the base docker directory to another location (part II)

Continuing from my last post , the process of putting the docker base directory in a remote mount point was completed with a relative success, because I’m still struggling with the fact that the permissions that NFS attribute to the users on the machine the share is mounted. Every new file or modified one is assigned, on the perspective of the docker container, to the user “nobody“, which presents a problem for some services/daemons like sshd, which start to complain if their configuration are world-readable and belonging to another that is not root. Now, the big docker image which is a mirror of my VPS storage is now residing on a share on my NAS. Still, when I try to update that image with the last modifications from the VPS, some things get not correctly updated, as the binary data storage engine of MySQL. Copying those ones (residing on /var/lib/mysql) present still some problems, or changing some of the way the rsync deals with binary files (didn’t investigated this issue). Return to the partition in which the Linux root partition is mounted, pointed again the docker configuration to the original /var/lib/docker and  decided, one by one, to remove all images from the docker storage. The problem is, after deleting all the layers from the VPS image, still had only 2 GB free ! The only way of solving was uninstalling completely and remove the /var/lib/docker in its entirety, hoping after restarting docker would create a fresh new one. Have to decide that way after peering at this Github issue page, in which is possible to conclude that the aufs driver is main responsible for the problem. I’m still using Ubuntu 16, since I prefer to stick with the LTS releases. I read on that threading page that the new Ubuntu releases on 17.x series are already using the overlay2 driver by default, which solves the problem of wasting storage space caused by the aufs driver. So, I’ll wait to the Ubuntu 18 LTS to upgrade my docker on that time and expect that the Docker base dir, which is now a mountpoint from my NAS would not cripple the free space on my NAS until then !

Update: I think I’m going to give up completely from using docker to use it as a storage backup of my VPS while the new overlay2 driver doesn’t come ready ! How it is possible that after making a raw copy of the files via rsync command is just occupying 3.5 GB without compression on my laptop ! Using docker with aufs is, literally saying, a waste of space!

 

Leave a Reply