#!/bin/bash
docker run -d
--privileged=true
--net [macvlan network]
--ip [ip in that network]
--name pihole
-p 53:53/tcp -p 53:53/udp
-p 80:80
-p 443:443
-e TZ="America/Chicago"
-v "$(pwd)/etc-pihole/:/etc/pihole/"
-v "$(pwd)/etc-dnsmasq.d/:/etc/dnsmasq.d/"
--dns=8.8.8.8 --dns=8.8.4.4
--restart=always
jkilloy/pihole:latest
printf 'Starting up pihole container ' for i in $(seq 1 20); do if [ "$(docker inspect -f "{{.State.Health.Status}}" pihole)" == "healthy" ] ; then printf ' OK' echo -e "\n$(docker logs pihole 2> /dev/null | grep 'password:') for your pi-hole: https://${IP}/admin/" exit 0 else sleep 3 printf '.' fi
if [ $i -eq 20 ] ; then
echo -e "\nTimed out waiting for Pi-hole start, consult check your container logs for more info (\`docker logs pihole\`)"
exit 1
fi
done;
Content type
Image
Digest
Size
142.4 MB
Last updated
over 6 years ago
docker pull jkilloy/pihole