Hello,
My Pi-hole container does not start automatically after a system (debian) restart :
$ sudo docker ps -a | grep pihole
ffb0952aee2a pihole/pihole:latest "/s6-init" 4 minutes ago Exited (128) About a minute ago pihole
$ sudo journalctl -u docker
...
time="2023-09-08T08:25:58.882268255+02:00" level=warning msg="Failed to allocate and map port 53-53: Error starting userland proxy: listen udp4 192.168.9.105:53: bind: cannot assign requested address"
time="2023-09-08T08:25:59.011007483+02:00" level=error msg="failed to start container" container=ffb0952aee2a6eaf77f99c0191b901da814acf1abf195b48c16cffdeeee33b71 error="driver failed programming external connectivity on endpoint pihole (9f1434b34c23047850468343890140a89012d63e38e1fbec0d1eac48752a1b3d): Error starting userland proxy: listen udp4 192.168.9.105:53: bind: cannot assign requested address"
...
If I manually restart using docker compose up -d
, Pi-hole starts
$ sudo docker ps -a | grep pihole
ffb0952aee2a pihole/pihole:latest "/s6-init" 8 minutes ago Up 16 seconds (health: starting) 0.0.0.0:53->53/tcp, 192.168.9.105:53->53/udp, :::53->53/tcp, 67/udp, 0.0.0.0:50080->80/tcp, :::50080->80/tcp pihole
Here is my docker-compose file :
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
networks:
- home
ports:
- "53:53/tcp"
- "192.168.9.105:53:53/udp"
- "50080:80/tcp"
environment:
TZ: ${TZ}
WEBPASSWORD: ${PIHOLE_WEBPASSWORD}
volumes:
- ${DATA_PATH}/pihole/etc-pihole/:/etc/pihole/
- ${DATA_PATH}/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/
- ${DATA_PATH}/pihole/var-log/pihole.log:/var/log/pihole.log
dns:
- 127.0.0.1
- 1.1.1.1
restart: always
networks:
home:
ipam:
config:
- subnet: 172.9.0.0/24
I did some tests/checks using a startup script (crontab reboot) :
- port 53 is not used (
nc -z -v -w 1 localhost 53
) - delaying pihole container start does not fix the problem (
sleep 120
)
If I remove my host IP from the docker-compose ("192.168.9.105:53:53/udp"
--> "53:53/udp"
), the Pi-hole container starts well after a system restart but I have DNS resolution issues with my other containers.
Thanks a lot for your help!
PS : My problem is similar to that one but using the official Pi-hole image : Issues when restarting image jacklul/pihole
Debian version: 11.5
Docker version: 24.0.6
Docker Compose version: v2.21.0
Pi-hole version: Docker Tag 2023.05.2 / Pi-hole v5.17.1 / FTL v5.23 / Web Interface v5.20.1