Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
>
> **Pi-hole v6 has been entirely redesigned from the ground up and contains many breaking changes.**
>
> Environment variable names have changed, script locations may have changed.
> [Environment variable names have changed](https://docs.pi-hole.net/docker/upgrading/v5-v6/), script locations may have changed.
>
> If you are using volumes to persist your configuration, be careful.<br>Replacing any `v5` image *(`2024.07.0` and earlier)* with a `v6` image will result in updated configuration files. **These changes are irreversible**.
>
Expand Down
25 changes: 19 additions & 6 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ RUN apk add --no-cache \
libcap \
logrotate \
ncurses \
nmap-ncat \
procps-ng \
psmisc \
shadow \
Expand All @@ -61,11 +60,25 @@ COPY crontab.txt /crontab.txt
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
#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
# if the branch is master we clone the latest tag as sometimes the master branch contains meta changes that have not been tagged
# (we need to create a new "master" branch to avoid the "detached HEAD" state for the version check to work correctly)

RUN clone_repo() { \
FORK="$1"; \
REPO="$2"; \
BRANCH="$3"; \
DEST="$4"; \
CLONE_BRANCH="$BRANCH"; \
if [ "$BRANCH" = "master" ]; then \
CLONE_BRANCH=$(curl -s https://api.github.com/repos/${FORK}/${REPO}/releases/latest | jq -r .tag_name); \
fi; \
git clone --branch "$CLONE_BRANCH" --single-branch --depth 1 "https://github.com/${FORK}/${REPO}.git" "$DEST"; \
cd "$DEST"; \
if [ "$BRANCH" = "master" ]; then git checkout -b master; fi; \
}; \
clone_repo "${WEB_FORK}" "web" "${WEB_BRANCH}" "/var/www/html/admin"; \
clone_repo "${CORE_FORK}" "pi-hole" "${CORE_BRANCH}" "/etc/.pihole"


RUN cd /etc/.pihole && \
install -Dm755 -d /opt/pihole && \
Expand Down