How to fix permissions of /var/lib/docker?

I’m running Docker version 20.10.22, on ArchLinux.

I’ve been running Docker for a while, and I noticed, it’s taking up A LOT of disk space because I do have A LOT of images :smile:

I decided to re-create the partitions on my hard drive, to free up some more space for Docker.

/var/lib/docker has been moved to a temporary location (another hard disk) while I was re-creating partitions and re-formatting my HD.
I then moved back everything, including this /var/lib/docker directory.
I remember I had a few (permission) warnings, while moving the files for /var/lib/docker.

No, I did not use rsync.
Yes, I should have used rsync.
I used the good ol’ MC! :joy:
(Midnight Commander has always been my best friend, but, not this time, apparently)

OK, so here’s the problem:
My docker images are basely usable. I’m getting a lot of different errors, about PERMISSIONS.
I read somewhere that the folder /var/lib/docker should have 701 permissions.
So, silly me went ahead and tried:

sudo chmod 701 /var/lib/docker -R

the -R (recursive) was not a good idea, apparently.
I completely messed the original permissions from the /var/lib/docker directory!

Now, I can run some images.
But I can’t BUILD anything :frowning:

I get this type of error all the time, while building a new image:

System error resolving '' - getaddrinfo (13: Permission denied)

It’s not a networking problem, it’s a PERMISSION problem.

Is there any way I can restore the CORRECT PERMISSIONS on the /var/lib/docker directory?