standardize the package download urls and simplify version retrieval

This commit is contained in:
aptalca
2019-01-28 15:40:42 -05:00
committed by Ryan Kuba
parent e18289b0f2
commit f540632b28
4 changed files with 42 additions and 30 deletions

View File

@@ -13,25 +13,29 @@ ENV XDG_CONFIG_HOME="/config/xdg"
ENV SONARR_BRANCH="develop"
RUN \
if [ -z ${SONARR_VERSION+x} ]; then \
SONARR_VERSION=$(curl -sX GET http://apt.sonarr.tv/dists/${SONARR_BRANCH}/main/binary-amd64/Packages \
|grep -A 6 -m 1 "Package: nzbdrone" | awk -F ": " '/Version/{print $2;exit}'); \
fi && \
echo "**** add sonarr repository ****" && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC && \
echo "deb http://apt.sonarr.tv/ ${SONARR_BRANCH} main" > \
/etc/apt/sources.list.d/sonarr.list && \
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y \
nzbdrone=${SONARR_VERSION} && \
jq && \
echo "**** install sonarr ****" && \
mkdir -p /opt/NzbDrone && \
if [ -z ${SONARR_VERSION+x} ]; then \
SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/download/${SONARR_BRANCH} \
| jq -r '.version'); \
fi && \
curl -o \
/tmp/sonarr.tar.gz -L \
"http://download.sonarr.tv/v2/${SONARR_BRANCH}/mono/NzbDrone.${SONARR_BRANCH}.${SONARR_VERSION}.mono.tar.gz" && \
tar xf \
/tmp/sonarr.tar.gz -C \
/opt/NzbDrone --strip-components=1 && \
echo "**** cleanup ****" && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files
COPY root/ /