-
-
Notifications
You must be signed in to change notification settings - Fork 140
/
Dockerfile
50 lines (43 loc) · 1.52 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
# set version label
ARG BUILD_DATE
ARG VERSION
ARG SONARR_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thespad"
# set environment variables
ENV XDG_CONFIG_HOME="/config/xdg" \
SONARR_CHANNEL="v4-stable" \
SONARR_BRANCH="main" \
COMPlus_EnableDiagnostics=0 \
TMPDIR=/run/sonarr-temp
RUN \
echo "**** install packages ****" && \
apk add --no-cache \
icu-libs \
sqlite-libs \
xmlstarlet && \
echo "**** install sonarr ****" && \
mkdir -p /app/sonarr/bin && \
if [ -z ${SONARR_VERSION+x} ]; then \
SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/releases \
| jq -r "first(.[] | select(.releaseChannel==\"${SONARR_CHANNEL}\") | .version)"); \
fi && \
curl -o \
/tmp/sonarr.tar.gz -L \
"https://services.sonarr.tv/v1/update/${SONARR_BRANCH}/download?version=${SONARR_VERSION}&os=linuxmusl&runtime=netcore&arch=x64" && \
tar xzf \
/tmp/sonarr.tar.gz -C \
/app/sonarr/bin --strip-components=1 && \
echo -e "UpdateMethod=docker\nBranch=${SONARR_BRANCH}\nPackageVersion=${VERSION:-LocalBuild}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/sonarr/package_info && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
rm -rf \
/app/sonarr/bin/Sonarr.Update \
/tmp/*
# add local files
COPY root/ /
# ports and volumes
EXPOSE 8989
VOLUME /config