Sign inSign up

dremer10/pihole

By dremer10

•Updated over 5 years ago

Image
0

221

dremer10/pihole repository overview

Make sure /etc/resolv.conf has nameserver pointing to 127.0.0.1 (in this case our pihole docker) if the docker container goes down for whatever reason then internet will be gone and you must change nameserver to 8.8.8.8 (google.com)

to run create the following pihole.sh adjust the docker_host ports to your setup

#!/bin/bash

# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md

docker run -d \
    --name pihole \
    -p 53:53/tcp -p 53:53/udp \
    -p 80:80 \
    -p 443:443 \
    -p 8080:8080 \
    -e TZ="America/LosAngeles" \
    -v "$(pwd)/etc-pihole/:/etc/pihole/" \
    -v "$(pwd)/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
    --dns=127.0.0.1 --dns=1.1.1.1 \
    --restart=unless-stopped \
    dremer10/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://${DOCK_HOST_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;

Tag summary

Content type

Image

Digest

Size

155.1 MB

Last updated

over 5 years ago

docker pull dremer10/pihole