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 <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2025-07-14 22:49:30 +01:00
parent 7de38f992a
commit d1e0e78f0e

View File

@@ -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 && \