From d1e0e78f0ef2fe85bf95a48697f98cc3814942c8 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 14 Jul 2025 22:49:30 +0100 Subject: [PATCH] Increase the depth of the clone by a little to account for there potentially being additonal commits ahead of the latest tag in both web and core repos. This is not always the case, but it prevents the built docker container having a broken version string Signed-off-by: Adam Warner --- src/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Dockerfile b/src/Dockerfile index f0893d0..26ddcae 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -60,9 +60,12 @@ COPY crontab.txt /crontab.txt # Add PADD to the container, too. ADD --chmod=0755 https://raw.githubusercontent.com/${PADD_FORK}/PADD/${PADD_BRANCH}/padd.sh /usr/local/bin/padd -# download a the main repos from github -RUN git clone --depth 1 --single-branch --branch ${WEB_BRANCH} https://github.com/${WEB_FORK}/web.git /var/www/html/admin && \ - git clone --depth 1 --single-branch --branch ${CORE_BRANCH} https://github.com/${CORE_FORK}/pi-hole.git /etc/.pihole +# download a the main repos from github +#if the branch is master we reset to the latest tag as sometimes the master branch contains meta changes that have not been tagged. +RUN git clone --depth 5 --single-branch --branch ${WEB_BRANCH} https://github.com/${WEB_FORK}/web.git /var/www/html/admin && \ + if [ "${WEB_BRANCH}" = "master" ]; then cd /var/www/html/admin && git reset --hard "$(git describe --tags --abbrev=0)"; fi && \ + git clone --depth 5 --single-branch --branch ${CORE_BRANCH} https://github.com/${CORE_FORK}/pi-hole.git /etc/.pihole && \ + if [ "${CORE_BRANCH}" = "master" ]; then cd /etc/.pihole && git reset --hard "$(git describe --tags --abbrev=0)"; fi RUN cd /etc/.pihole && \ install -Dm755 -d /opt/pihole && \