2023-07-03 21:55:14 +02:00
|
|
|
ARG CONTAINER="3.18"
|
|
|
|
FROM alpine:${CONTAINER}
|
2023-06-19 22:39:24 +02:00
|
|
|
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
|
|
|
ARG TARGETPLATFORM
|
2018-10-30 06:20:45 +01:00
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
# download a repo from github
|
2023-06-19 22:39:24 +02:00
|
|
|
# TODO - probably remove a lot of these
|
|
|
|
RUN apk add --no-cache git \
|
|
|
|
bash \
|
|
|
|
curl \
|
|
|
|
bind-tools \
|
|
|
|
nmap-ncat \
|
|
|
|
psmisc \
|
|
|
|
sudo \
|
|
|
|
unzip \
|
|
|
|
wget \
|
|
|
|
libidn \
|
|
|
|
nettle \
|
|
|
|
libcap \
|
|
|
|
openresolv \
|
|
|
|
iproute2-ss \
|
|
|
|
jq \
|
|
|
|
coreutils \
|
|
|
|
dialog \
|
|
|
|
newt \
|
|
|
|
procps \
|
|
|
|
dhcpcd \
|
|
|
|
openrc \
|
|
|
|
ncurses \
|
2023-07-03 20:06:55 +02:00
|
|
|
nano \
|
|
|
|
less
|
2023-06-19 22:39:24 +02:00
|
|
|
|
|
|
|
# download a the main repos from github
|
2023-06-19 00:09:34 +02:00
|
|
|
RUN git clone --branch development-v6 https://github.com/pi-hole/AdminLTE.git /var/www/html/admin
|
2023-02-16 00:48:53 +01:00
|
|
|
RUN git clone --branch development-v6 https://github.com/pi-hole/pi-hole.git /etc/.pihole
|
2017-10-02 06:25:57 +02:00
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
# Download the latest version of pihole-FTL for alpine:
|
2023-06-19 22:39:24 +02:00
|
|
|
# Probably need this to be built for different FTLARCHs
|
|
|
|
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then FTLARCH=amd64; \
|
|
|
|
elif [ "$TARGETPLATFORM" = "linux/386" ]; then FTLARCH=386; \
|
|
|
|
elif [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then FTLARCH=armv6; \
|
|
|
|
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then FTLARCH=armv7; \
|
|
|
|
elif [ "$TARGETPLATFORM" = "linux/arm64/v8" ]; then FTLARCH=armv64; \
|
|
|
|
elif [ "$TARGETPLATFORM" = "linux/riscv64" ]; then FTLARCH=riscv64; \
|
|
|
|
else FTLARCH=amd64; fi \
|
2023-06-21 20:17:29 +02:00
|
|
|
&& curl -sSL "https://ftl.pi-hole.net/development-v6/pihole-FTL-${FTLARCH}" -o /usr/bin/pihole-FTL && \
|
|
|
|
chmod +x /usr/bin/pihole-FTL
|
2023-06-19 22:39:24 +02:00
|
|
|
|
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
ADD https://ftl.pi-hole.net/macvendor.db /macvendor.db
|
2023-07-03 23:54:49 +02:00
|
|
|
ADD crontab.txt /crontab.txt
|
2017-10-02 06:25:57 +02:00
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
RUN cd /etc/.pihole && \
|
|
|
|
install -Dm755 -d /opt/pihole && \
|
|
|
|
install -Dm755 -t /opt/pihole gravity.sh && \
|
|
|
|
install -Dm755 -t /opt/pihole ./advanced/Scripts/*.sh && \
|
|
|
|
install -Dm755 -t /opt/pihole ./automated\ install/uninstall.sh && \
|
|
|
|
install -Dm755 -t /opt/pihole ./advanced/Scripts/COL_TABLE && \
|
|
|
|
install -Dm755 -t /usr/local/bin pihole && \
|
2023-06-21 20:17:29 +02:00
|
|
|
install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole && \
|
|
|
|
install -T -m 0755 ./advanced/Templates/pihole-FTL-prestart.sh /opt/pihole/pihole-FTL-prestart.sh && \
|
|
|
|
install -T -m 0755 ./advanced/Templates/pihole-FTL-poststop.sh /opt/pihole/pihole-FTL-poststop.sh
|
|
|
|
|
2021-12-10 21:51:35 +01:00
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
ENV DNSMASQ_USER=pihole
|
|
|
|
ENV FTL_CMD=no-daemon
|
|
|
|
RUN addgroup -S pihole && adduser -S pihole -G pihole
|
|
|
|
# RUN groupadd pihole && useradd -r --no-user-group -g pihole -s /usr/sbin/nologin pihole
|
2022-05-26 21:42:59 +02:00
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
ADD bash_functions.sh /usr/bin/bash_functions.sh
|
|
|
|
ADD start.sh /usr/bin/start.sh
|
2017-10-02 06:25:57 +02:00
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
RUN chmod +x /usr/bin/start.sh
|
2023-06-21 20:17:29 +02:00
|
|
|
|
2022-08-29 17:33:41 +02:00
|
|
|
|
2018-08-04 20:31:58 +02:00
|
|
|
|
2021-08-22 21:20:38 +02:00
|
|
|
HEALTHCHECK CMD dig +short +norecurse +retry=0 @127.0.0.1 pi.hole || exit 1
|
2018-01-10 23:05:54 +01:00
|
|
|
|
2023-02-16 00:48:53 +01:00
|
|
|
ENTRYPOINT [ "start.sh" ]
|