590 posts in this topic Last Reply 2 hours ago

Recommended Posts

I wrote the template that pulls in the Official Docker Container from PiHole. I swapped over from my unofficial one a long time ago that that a fully supported version could be distributed. Make sure that your repository for pihole is = pihole/pihole:latest and not the old diginc repository.

If you use the latest tag, you should have v 4.0.0-1. The release tags are here: https://hub.docker.com/r/pihole/pihole/tags/

The last update to the docker image was 12 days ago. Apparently you should not do an update within the docker image (that was what diginc said - although that may have changed)

If you have a problem with the docker image, you should ask about it here: - https://discourse.pi-hole.net/ or on the github here:- https://github.com/pi-hole/pi-hole/issues

*** Updated Nov5 2017***

New Version2 of the Template for the pihole docker.

===== the text below may have been superseded, check the video first ====

NOTE:

**** The directories have changed so that you will need to recreate your blacklist/whitelist. These are not overwritten so that you can find them in your original appdata folder. Use the admin front end to add them. ***

This docker need ports 53 (dns) and 80 (web) to work correctly. Change your Unraid admin port to 81 or use the new Docker IP functionality in unraid v6.4 to give it its own ip address.

Variables:

ServerIP = IP address of the Docker(v6.4) or the unraid server that it is running on.

It is currently marked as BETA because it needs some manual steps to make it work:

1) **** Change your default port for unRaid ****

in your /boot/config/go file you will need to set your webui port to something other than 80, so that pihole can serve up blank pixels instead of adverts. I have set mine to port 81:

# Start the Management Utility
/usr/local/sbin/emhttp -p 81&

2) in your appdata/pihole directory, it will have created 3 directories. Delete these directories and create 3 files (of the same name):

touch blacklist.txt whitelist.txt pihole.log

If you don't do this, it will not start.

3) the log file grows quickly. Use a cron job to delete it each night:

create a file called pihole.cron in the /boot/config/plugins/pihole directory, with these contents:

# Pi-hole: A black hole for Internet advertisements
# (c) 2015, 2016 by Jacob Salmela
# Network-wide ad blocking via your Raspberry Pi
# http://pi-hole.net
# Updates ad sources every week
#
# Pi-hole is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# Your container name goes here:
#DOCKER_NAME=pihole-for-unRaid
#PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Pi-hole: Update the ad sources once a week on Sunday at 01:59
# Download any updates from the adlists
59 1 * * 7 root docker exec pihole-for-unRaid pihole updateGravity > /dev/null
# Pi-hole: Update the Web interface shortly after gravity runs
# This should also update the version number if it is changed in the dashboard repo
#30 2 * * 7 root docker exec pihole-for-unRaid pihole updateDashboard > /dev/null
# Pi-hole: Parse the log file before it is flushed and save the stats to a database
# This will be used for a historical view of your Pi-hole's performance
#50 23 * * * root docker exec pihole-for-unRaid dailyLog.sh # note: this is outdated > /dev/null
# Pi-hole: Flush the log daily at 11:58 so it doesn't get out of control
# Stats will be viewable in the Web interface thanks to the cron job above
58 23 * * * root docker exec pihole-for-unRaid pihole flush > /dev/null

(I need to confirm that this is correct!!!!)

Start the pihole-for-unRaid docker and then set your DNS on your computers to use the ipaddress of the unRaid server.

You can change server details and dns details in the template.

Let me know how you get on!.

Edited October 28, 2018 by spantsupdated

3

Share this post

Link to post

Interesting. I'll give this a go, but wondered if you'd tried getting it working without needing to change the emhttp port? Wonder if there's some way to get emhttp to serve the blank pixel images? Only thing is that may cause some problems with the what I believe is single threaded approach of emhttp....

Share this post

Link to post

if the docker can run on a separate ip on the network then you wouldn't have to change the port. The problem is that the redirection of calls to ads is done via an ip address with no port info (uses dnsmasq).

Share this post

Link to post

Since i use it the tvheadend did stop stream and when i change the the port for unraid back to 80 but the tvheadend problem still there

So i hope you can do anything about it

great work keep it up

I already asked this above. It's not possible to change the port. Incidentally I don't think that this is anything to do with your TVH problem as that doesn't use port 80 or any of the ports required here afaik.

Share this post

Link to post

Have the docker running in host mode (won't ruin in other network modes). I can access the admin page but pihole doesn't seem to be accepting dns requests. No activity is noted in the admin page. I have dual nics on my rig so not sure if that is causing problems? Thanks for your hard work!

Share this post

Link to post

Log attached. Pi-hole admin console is accessable at my server's IP address and show's active but no ads are being filtered. Set primary DNS on my router to point to the server. Any help is appreciated.

diginc added a parameter to meet the necessary changes that urged spants to create his container, which is disabling IPV6 support so if you add a new container variable:

Name: Key 4

Key: IPv6

Value: False

Default Value: False

you should be up and running as spants designed but using the container that follows the pi-hole development a bit closer. Been running for a few weeks and haven't had an issue.

One other thing I did was install the User Scripts plugin and then create the cron script in: /boot/config/plugins/user.scripts/scripts/pihole/ (following the plugin structure, the script is named 'script'). Then I edit the UserScript settings to run it at the interval of my choosing (each morning).

My script looks like (just converted the cron file):

#!/bin/bash

DOCKER_NAME=pihole

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Download any updates from the adlists

docker exec $DOCKER_NAME pihole updateGravity > /dev/null

# Pi-hole: Update the Web interface shortly after gravity runs

# This should also update the version number if it is changed in the dashboard repo

#docker exec $DOCKER_NAME pihole updateDashboard > /dev/null

# Pi-hole: Parse the log file before it is flushed and save the stats to a database

# This will be used for a historical view of your Pi-hole's performance