The docker container should "just work", so this is confusing me here. Just in case he did not see the assignment, I'll ping @diginc to take a closer look at this thread, he is the docker guru!
I am using this version of the container and not seeing any issues.
FWIW my compose file: (though you ignore the traefik labels and probably the dependency on unbound - note I am using macvlan - hence MAC address - also I'm not very good at docker, so there is probably superflous stuff in there!)
Nothing stood out to me so far. Since no one suggested it one thing worth attempting is running FTL as non-root (probably need to remove all volume data again for the switch) which we have a env var for:
ok add "DNSMASQ_USER=pihole" to my compose file, removed everything related to Pihole 5.0 and it makes no difference.
I'm running a reasonable up2date "Ubuntu 20.04" with "Docker version 19.03.6, build 369ce74a3c", could this be a problem?
Maybe other people running Pihole 5.0 on these versions?
ah 20.04...the latest ubuntu which is not officially 'docker supported' (as in Docker Inc) yet and untested by myself. There have been a few other negative reports coming in for 20.04.
If its not above your head could you attempt querying apparmor for any sort of denies it might be doing in pihole's container?
Apparmor has been my #1 theory for permission issues in Pi-hole docker 20.04
Another easy test to see if its to blame is disable docker's apparmor
After applying these settings I ran "sudo aa-status | grep FTL" and it return nothing.
While without these settings it returned "/usr/bin/pihole-FTL docker-default".
From that I conclude that the settings do what the should do; disable AppArmor for PiHole.
With or without AppArmor disabled, I always get the write to readonly database error.
Also tried dozens of combination on gid/uid, privileged, dns_masq, nothing is working...
YES....found something.... Don't know if i'm happy with it, but its looks like a start to solve this.
User www-data is causing the problem looking at the sql statement executed with -u www-data.
So I search a lot on "docker write permission www-data" and looks like "www-data" has "troubles" to writing to a docker volume/share directory and/or sqlite don't like to have a database on a docker volume.
So I unshared the /etc/pihole directory and everything is working as a charme.
If you search on stuff like database on docker volumes you find a load of problems.
maybe its an idea to move the database to a different directory?
For what its worth for now;
xxx@xxx-xxx:/opt/docker$ dpkg -l | grep docker
ii docker-ce 5:19.03.6~3-0~ubuntu-disco amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:19.03.6~3-0~ubuntu-disco amd64 Docker CLI: the open-source application container engine
Have a look at the ACLs of your shared /etc/pihole directory. Your directory listing shows by the + sign at the end of the permissions that ACLs are set. This might prevent docker to have write access.
Is this good or bad and what command should I run to fix it?
Did some fiddeling and couldn't find a working solution with ACL.
So I decided to "reset" ACL on the volume dir; sudo setfacl -Rbn /opt/docker/pihole_v5/
So the error "attempt to write a readonly database" was in my case solved by resetting the ACL with this command; sudo setfacl -Rbn /opt/docker/pihole_v5/