forked from bradpeczka/docker-nzbget-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
143 lines (136 loc) · 3.86 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Buildstage
FROM ghcr.io/linuxserver/baseimage-alpine:3.18 as buildstage
# set NZBGET version
ARG NZBGET_RELEASE
RUN \
echo "**** install build packages ****" && \
apk add \
g++ \
gcc \
git \
libcap-dev \
libxml2-dev \
libxslt-dev \
make \
automake \
autoconf \
ncurses-dev \
openssl-dev && \
echo "**** build nzbget ****" && \
# FIXME: once nzbget-ng sort releases
# if [ -z ${NZBGET_RELEASE+x} ]; then \
# NZBGET_RELEASE=$(curl -sX GET "https://api.github.com/repos/nzbget/nzbget/releases/latest" \
# | awk '/tag_name/{print $4;exit}' FS='[""]'); \
# fi && \
mkdir -p /app/nzbget && \
git clone https://github.com/nzbget-ng/nzbget.git nzbget && \
cd nzbget/ && \
autoreconf --install && \
git checkout ${NZBGET_RELEASE} && \
# git cherry-pick -n fa57474d && \
./configure \
bindir='${exec_prefix}' && \
make -j32 && \
make prefix=/app/nzbget install && \
sed -i \
-e "s#^MainDir=.*#MainDir=/downloads#g" \
-e "s#^ScriptDir=.*#ScriptDir=$\{MainDir\}/scripts#g" \
-e "s#^WebDir=.*#WebDir=$\{AppDir\}/webui#g" \
-e "s#^ConfigTemplate=.*#ConfigTemplate=$\{AppDir\}/webui/nzbget.conf.template#g" \
-e "s#^UnrarCmd=.*#UnrarCmd=$\{AppDir\}/unrar#g" \
-e "s#^SevenZipCmd=.*#SevenZipCmd=$\{AppDir\}/7za#g" \
-e "s#^CertStore=.*#CertStore=$\{AppDir\}/cacert.pem#g" \
-e "s#^CertCheck=.*#CertCheck=yes#g" \
-e "s#^DestDir=.*#DestDir=$\{MainDir\}/completed#g" \
-e "s#^InterDir=.*#InterDir=$\{MainDir\}/intermediate#g" \
-e "s#^LogFile=.*#LogFile=$\{MainDir\}/nzbget.log#g" \
-e "s#^AuthorizedIP=.*#AuthorizedIP=127.0.0.1#g" \
/app/nzbget/share/nzbget/nzbget.conf && \
mv /app/nzbget/share/nzbget/webui /app/nzbget/ && \
cp /app/nzbget/share/nzbget/nzbget.conf /app/nzbget/webui/nzbget.conf.template && \
ln -s /usr/bin/7za /app/nzbget/7za && \
ln -s /usr/bin/unrar /app/nzbget/unrar && \
cp /nzbget/pubkey.pem /app/nzbget/pubkey.pem && \
curl -o \
/app/nzbget/cacert.pem -L \
"https://curl.haxx.se/ca/cacert.pem"
# Runtime Stage
FROM ghcr.io/linuxserver/baseimage-alpine:3.18
ARG UNRAR_VERSION=6.2.4
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="jb044"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --upgrade --virtual=build-dependencies \
cargo \
g++ \
gcc \
libc-dev \
libffi-dev \
libxml2-dev \
libxslt-dev \
make \
python3-dev && \
echo "**** install packages ****" && \
apk add --no-cache \
libcap \
libxml2 \
libxslt \
openjdk17-jre-headless \
openssl \
p7zip \
py3-pip \
python3 && \
echo "**** install unrar from source ****" && \
mkdir /tmp/unrar && \
curl -o \
/tmp/unrar.tar.gz -L \
"https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \
tar xf \
/tmp/unrar.tar.gz -C \
/tmp/unrar --strip-components=1 && \
cd /tmp/unrar && \
make && \
install -v -m755 unrar /usr/bin && \
echo "**** install python packages ****" && \
pip3 install --no-cache-dir -U \
pip \
wheel && \
pip install --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.18/ \
apprise \
beets \
chardet \
jellyfish==0.10.0 \
lxml \
py7zr \
pynzbget \
rarfile \
six && \
#apk add --no-cache \
# py3-wheel \
# py3-apprise \
# py3-beets \
# py3-chardet \
# py3-jellyfish \
# py3-lxml \
# py3-py7zr \
# py3-pynzbget \
# py3-rarfile \
# py3-six && \
# ln -s /usr/bin/python3 /usr/bin/python && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cache \
/root/.cargo \
/tmp/*
# add local files and files from buildstage
COPY --from=buildstage /app/nzbget /app/nzbget
COPY root/ /
# ports and volumes
VOLUME /config
EXPOSE 6789