Created
December 29, 2019 17:59
-
-
Save jaedle/6f6a468911e9317eda8d125056410466 to your computer and use it in GitHub Desktop.
pihole-docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export WEBPASSWORD=changeme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| SCRIPT=$(readlink -f "$0") | |
| SERVICE_PATH=$(dirname "$SCRIPT") | |
| source "$SERVICE_PATH/.credentials.rc" | |
| IP="$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')" | |
| docker container run \ | |
| -d \ | |
| --name pihole \ | |
| -p 53:53/tcp -p 53:53/udp \ | |
| -p 67:67/udp \ | |
| -p 80:80 \ | |
| -v "${SERVICE_PATH}/pihole/:/etc/pihole/" \ | |
| -v "${SERVICE_PATH}/dnsmasq.d/:/etc/dnsmasq.d/" \ | |
| -e ServerIP="${IP}" \ | |
| --restart=always \ | |
| --cap-add=NET_ADMIN \ | |
| --dns=127.0.0.1 \ | |
| --dns=192.168.2.1 \ | |
| -e TZ=DE \ | |
| -e WEBPASSWORD="$WEBPASSWORD" \ | |
| pihole/pihole:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment