Skip to content

Commit 1f618bb

Browse files
authored
Merge pull request #1866 from pi-hole/slightly-deeper-clone
Prevent cosmetic issue where component versions are sometimes labeled as commit hashes
2 parents 7de38f9 + d1e0e78 commit 1f618bb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ COPY crontab.txt /crontab.txt
6060
# Add PADD to the container, too.
6161
ADD --chmod=0755 https://raw.githubusercontent.com/${PADD_FORK}/PADD/${PADD_BRANCH}/padd.sh /usr/local/bin/padd
6262

63-
# download a the main repos from github
64-
RUN git clone --depth 1 --single-branch --branch ${WEB_BRANCH} https://github.com/${WEB_FORK}/web.git /var/www/html/admin && \
65-
git clone --depth 1 --single-branch --branch ${CORE_BRANCH} https://github.com/${CORE_FORK}/pi-hole.git /etc/.pihole
63+
# download a the main repos from github
64+
#if the branch is master we reset to the latest tag as sometimes the master branch contains meta changes that have not been tagged.
65+
RUN git clone --depth 5 --single-branch --branch ${WEB_BRANCH} https://github.com/${WEB_FORK}/web.git /var/www/html/admin && \
66+
if [ "${WEB_BRANCH}" = "master" ]; then cd /var/www/html/admin && git reset --hard "$(git describe --tags --abbrev=0)"; fi && \
67+
git clone --depth 5 --single-branch --branch ${CORE_BRANCH} https://github.com/${CORE_FORK}/pi-hole.git /etc/.pihole && \
68+
if [ "${CORE_BRANCH}" = "master" ]; then cd /etc/.pihole && git reset --hard "$(git describe --tags --abbrev=0)"; fi
6669

6770
RUN cd /etc/.pihole && \
6871
install -Dm755 -d /opt/pihole && \

0 commit comments

Comments
 (0)