Edit: Details reduced
Hello,
I try to setup pihole in docker on a Ubuntu 22.04.03 LTS machine, using volumes on a nfs4 share on a separat Synology NAS. Below are the permissions of two folders in that share:
drwxrwxr-x 2 admin users 4096 Oct 10 00:10 configuration
drwxrwxrwx+ 2 admin users 4096 Oct 10 00:10 dnsmasq
NFS rule Sqash: Map root to admin
is turned on. The UID and GID of admin is 1024:100
I use this docker-compose:
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
restart: always
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
environment:
PIHOLE_UID: 1024
PIHOLE_GID: 100
TZ: "Europe/Berlin"
volumes:
- configuration:/etc/pihole
- dnsmasq:/etc/dnsmasq.d
volumes:
configuration:
name: pihole_configuration
driver: local
driver_opts:
type: nfs
o: addr=nas,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14,nfsvers=4
device: ":/volume1/homelab/docker/volumes/pihole/configuration"
dnsmasq:
name: pihole_dnsmasq
driver: local
driver_opts:
type: nfs
o: addr=nas,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14,nfsvers=4
device: ":/volume1/homelab/docker/volumes/pihole/dnsmasq"
When I run this compose file the volumes are created but I get this error:
Error response from daemon: failed to copy file info for /var/lib/docker/volumes/pihole_configuration/_data: failed to chown /var/lib/docker/volumes/pihole_configuration/_data: lchown /var/lib/docker/volumes/pihole_configuration/_data: operation not permitted
The docker-compose file and the environment options for PIHOLE_UID
and PIHOLE_GID
are based on GitHub - pi-hole/docker-pi-hole: Pi-hole in a docker container. Unfortunately I didn't find sufficient info on how to use PIHOLE_UID
and PIHOLE_GID
...
What am I doing wrong?
Just as a side note: I have several docker containers (portainer, watchtower, homer, ...) running with volumes on nfs shares, so the basic setup seems to be working.
Any help is greatly appreciated!
Nice Regards
Christian