@@ -3,8 +3,9 @@ FROM ghcr.io/daemonless/arr-base:${BASE_VERSION}
33
44ARG FREEBSD_ARCH=amd64
55ARG PACKAGES="sonarr"
6- ARG UPSTREAM_URL="https://services.sonarr.tv/v1/releases"
7- ARG UPSTREAM_SED="s/.*\" v4-stable\" :{[^}]*\" version\" :\"\\ ([^\" ]*\\ )\" .*/\\ 1/p"
6+ ARG SONARR_BRANCH="main"
7+ ARG UPSTREAM_URL="https://services.sonarr.tv/v1/download/main/latest?version=4&os=freebsd"
8+ ARG UPSTREAM_SED="grep -o '\" version\" :\" [^\" ]*\" ' | head -1 | cut -d'\" ' -f4"
89
910LABEL org.opencontainers.image.title="Sonarr" \
1011 org.opencontainers.image.description="Sonarr TV show management on FreeBSD" \
@@ -29,15 +30,11 @@ RUN pkg update && \
2930 pkg clean -ay && \
3031 rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
3132
32- # Download and install Sonarr (fetch latest v4-stable FreeBSD URL from API)
33+ # Download and install Sonarr
3334RUN mkdir -p /usr/local/share/sonarr /config && \
34- SONARR_VERSION=$(fetch -qo - "${UPSTREAM_URL}" | \
35- sed -n "${UPSTREAM_SED}" | head -1) && \
36- SONARR_URL=$(fetch -qo - "https://services.sonarr.tv/v1/releases" | \
37- grep -o '"freeBsd":{"x64":{"archive":{"url":"[^"]*"' | \
38- sed -n '1s/.*"url":"\( [^"]*\) ".*/\1 /p' ) && \
39- echo "Downloading Sonarr $SONARR_VERSION from: $SONARR_URL" && \
40- fetch -qo - "$SONARR_URL" | \
35+ SONARR_VERSION=$(fetch -qo - "https://services.sonarr.tv/v1/releases" | \
36+ grep -o '"v4-stable":{[^}]*"version":"[^"]*"' | grep -o '"version":"[^"]*"' | cut -d'"' -f4) && \
37+ fetch -qo - "https://services.sonarr.tv/v1/download/${SONARR_BRANCH}/latest?version=4&os=freebsd" | \
4138 tar xzf - -C /usr/local/share/sonarr --strip-components=1 && \
4239 rm -rf /usr/local/share/sonarr/Sonarr.Update && \
4340 chmod +x /usr/local/share/sonarr/Sonarr && \
0 commit comments