initial commit on configdir as volume
Signed-off-by: Martin Buchleitner <mabunixda@gmail.com>
This commit is contained in:
parent
cf36276d21
commit
c1fb17a645
|
@ -1,5 +1,6 @@
|
|||
FROM {{ pihole.base }}
|
||||
|
||||
ENV CONFIG_DIR /etc/pihole
|
||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/{{ pihole.s6_version }}/s6-overlay-{{ pihole.s6arch }}.tar.gz
|
||||
COPY install.sh /usr/local/bin/install.sh
|
||||
COPY VERSION /etc/docker-pi-hole-version
|
||||
|
@ -44,5 +45,6 @@ LABEL maintainer="{{ pihole.maintainer }}"
|
|||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
HEALTHCHECK CMD dig @127.0.0.1 pi.hole || exit 1
|
||||
VOLUME $CONFIG_DIR
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
FROM multiarch/debian-debootstrap:arm64-stretch-slim
|
||||
|
||||
ENV CONFIG_DIR /etc/pihole
|
||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-aarch64.tar.gz
|
||||
COPY install.sh /usr/local/bin/install.sh
|
||||
COPY VERSION /etc/docker-pi-hole-version
|
||||
|
@ -44,5 +45,6 @@ LABEL maintainer="adam@diginc.us"
|
|||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
HEALTHCHECK CMD dig @127.0.0.1 pi.hole || exit 1
|
||||
VOLUME $CONFIG_DIR
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
|
@ -1,5 +1,6 @@
|
|||
FROM pihole/debian-base:latest
|
||||
|
||||
ENV CONFIG_DIR /etc/pihole
|
||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-amd64.tar.gz
|
||||
COPY install.sh /usr/local/bin/install.sh
|
||||
COPY VERSION /etc/docker-pi-hole-version
|
||||
|
@ -44,5 +45,6 @@ LABEL maintainer="adam@diginc.us"
|
|||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
HEALTHCHECK CMD dig @127.0.0.1 pi.hole || exit 1
|
||||
VOLUME $CONFIG_DIR
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
|
@ -1,5 +1,6 @@
|
|||
FROM multiarch/debian-debootstrap:armel-stretch-slim
|
||||
|
||||
ENV CONFIG_DIR /etc/pihole
|
||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-arm.tar.gz
|
||||
COPY install.sh /usr/local/bin/install.sh
|
||||
COPY VERSION /etc/docker-pi-hole-version
|
||||
|
@ -44,5 +45,6 @@ LABEL maintainer="adam@diginc.us"
|
|||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
HEALTHCHECK CMD dig @127.0.0.1 pi.hole || exit 1
|
||||
VOLUME $CONFIG_DIR
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
|
@ -1,5 +1,6 @@
|
|||
FROM multiarch/debian-debootstrap:armhf-stretch-slim
|
||||
|
||||
ENV CONFIG_DIR /etc/pihole
|
||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-armhf.tar.gz
|
||||
COPY install.sh /usr/local/bin/install.sh
|
||||
COPY VERSION /etc/docker-pi-hole-version
|
||||
|
@ -44,5 +45,6 @@ LABEL maintainer="adam@diginc.us"
|
|||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
HEALTHCHECK CMD dig @127.0.0.1 pi.hole || exit 1
|
||||
VOLUME $CONFIG_DIR
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
|
@ -54,7 +54,7 @@ prepare_configs() {
|
|||
touch /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
|
||||
chown pihole:pihole /var/run/pihole /var/log/pihole
|
||||
test -f /var/run/pihole/FTL.sock && rm /var/run/pihole/FTL.sock
|
||||
chown pihole:pihole /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /etc/pihole /etc/pihole/dhcp.leases /var/log/pihole.log
|
||||
chown pihole:pihole /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port $CONFIG_DIR $CONFIG_DIR/dhcp.leases /var/log/pihole.log
|
||||
chmod 0644 /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
|
||||
set -e
|
||||
# Update version numbers
|
||||
|
@ -117,7 +117,7 @@ setup_dnsmasq_dns() {
|
|||
fi;
|
||||
|
||||
# TODO With the addition of this to /start.sh this needs a refactor
|
||||
if [ ! -f /.piholeFirstBoot ] ; then
|
||||
if [ ! -f $CONFIG_DIR/.piholeFirstBoot ] ; then
|
||||
local setupDNS1="$(grep 'PIHOLE_DNS_1' ${setupVars})"
|
||||
local setupDNS2="$(grep 'PIHOLE_DNS_2' ${setupVars})"
|
||||
setupDNS1="${setupDNS1/PIHOLE_DNS_1=/}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
mkdir -p /etc/pihole/
|
||||
mkdir -p $CONFIG_DIR/
|
||||
mkdir -p /var/run/pihole
|
||||
# Production tags with valid web footers
|
||||
export CORE_VERSION="$(cat /etc/docker-pi-hole-version)"
|
||||
|
@ -84,12 +84,12 @@ else
|
|||
fi
|
||||
|
||||
sed -i 's/readonly //g' /opt/pihole/webpage.sh
|
||||
sed -i '/^WEBPASSWORD/d' /etc/pihole/setupVars.conf
|
||||
sed -i '/^WEBPASSWORD/d' $CONFIG_DIR/setupVars.conf
|
||||
|
||||
# Replace the call to `updatePiholeFunc` in arg parse with new `unsupportedFunc`
|
||||
sed -i $'s/helpFunc() {/unsupportedFunc() {\\\n echo "Function not supported in Docker images"\\\n exit 0\\\n}\\\n\\\nhelpFunc() {/g' /usr/local/bin/pihole
|
||||
sed -i $'s/)\s*updatePiholeFunc/) unsupportedFunc/g' /usr/local/bin/pihole
|
||||
|
||||
touch /.piholeFirstBoot
|
||||
touch $CONFIG_DIR/.piholeFirstBoot
|
||||
|
||||
echo 'Docker install successful'
|
||||
|
|
17
start.sh
17
start.sh
|
@ -15,7 +15,7 @@ export DNSMASQ_LISTENING_BEHAVIOUR="$DNSMASQ_LISTENING"
|
|||
export IPv6
|
||||
export WEB_PORT
|
||||
|
||||
export adlistFile='/etc/pihole/adlists.list'
|
||||
export adlistFile='$CONFIG_DIR/adlists.list'
|
||||
|
||||
# The below functions are all contained in bash_functions.sh
|
||||
. /bash_functions.sh
|
||||
|
@ -27,16 +27,12 @@ echo " ::: Starting docker specific checks & setup for docker pihole/pihole"
|
|||
|
||||
docker_checks
|
||||
|
||||
# TODO:
|
||||
#if [ ! -f /.piholeFirstBoot ] ; then
|
||||
# echo " ::: Not first container startup so not running docker's setup, re-create container to run setup again"
|
||||
#else
|
||||
# regular_setup_functions
|
||||
#fi
|
||||
|
||||
fix_capabilities
|
||||
generate_password
|
||||
validate_env || exit 1
|
||||
|
||||
if [ -f $CONFIG_DIR/.piholeFirstBoot ] || [ -z "$(ls -A $CONFIG_DIR)" ] ; then
|
||||
|
||||
generate_password
|
||||
prepare_configs
|
||||
change_setting "IPV4_ADDRESS" "$ServerIP"
|
||||
change_setting "IPV6_ADDRESS" "$ServerIPv6"
|
||||
|
@ -48,8 +44,9 @@ setup_dnsmasq_hostnames "$ServerIP" "$ServerIPv6" "$HOSTNAME"
|
|||
setup_ipv4_ipv6
|
||||
setup_lighttpd_bind "$ServerIP"
|
||||
setup_blocklists
|
||||
fi
|
||||
test_configs
|
||||
|
||||
[ -f /.piholeFirstBoot ] && rm /.piholeFirstBoot
|
||||
[ -f $CONFIG_DIR/.piholeFirstBoot ] && rm $CONFIG_DIR/.piholeFirstBoot
|
||||
|
||||
echo " ::: Docker start setup complete"
|
||||
|
|
Loading…
Reference in New Issue