-
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Dockerfile
211 lines (193 loc) · 5.04 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# syntax=docker/dockerfile:1
############## picons stage ##############
# built by https://github.com/linuxserver/picons-builder
FROM ghcr.io/linuxserver/picons-builder as piconsstage
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as buildstage
############## build stage ##############
# package versions
ARG ARGTABLE_VER="2.13"
# environment settings
ARG TZ="Etc/UTC"
ARG TVHEADEND_COMMIT
ENV HOME="/config"
# copy patches and picons
COPY patches/ /tmp/patches/
COPY --from=piconsstage /picons.tar.bz2 /picons.tar.bz2
RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
autoconf \
automake \
bsd-compat-headers \
build-base \
cmake \
ffmpeg4-dev \
file \
findutils \
gettext-dev \
git \
gnu-libiconv-dev \
libdvbcsa-dev \
libgcrypt-dev \
libhdhomerun-dev \
libtool \
libva-dev \
libvpx-dev \
libxml2-dev \
libxslt-dev \
linux-headers \
openssl-dev \
opus-dev \
patch \
pcre2-dev \
pkgconf \
pngquant \
python3 \
sdl2-dev \
uriparser-dev \
x264-dev \
x265-dev \
zlib-dev
RUN \
echo "**** remove musl iconv.h and replace with gnu-iconv.h ****" && \
rm -rf /usr/include/iconv.h && \
cp /usr/include/gnu-libiconv/iconv.h /usr/include/iconv.h
RUN \
echo "**** compile tvheadend ****" && \
if [ -z ${TVHEADEND_COMMIT+x} ]; then \
TVHEADEND_COMMIT=$(curl -sX GET https://api.github.com/repos/tvheadend/tvheadend/commits/master \
| jq -r '. | .sha'); \
fi && \
mkdir -p \
/tmp/tvheadend && \
git clone https://github.com/tvheadend/tvheadend.git /tmp/tvheadend && \
cd /tmp/tvheadend && \
git checkout ${TVHEADEND_COMMIT} && \
./configure \
`#Encoding` \
--disable-ffmpeg_static \
--disable-libfdkaac_static \
--disable-libtheora_static \
--disable-libopus_static \
--disable-libvorbis_static \
--disable-libvpx_static \
--disable-libx264_static \
--disable-libx265_static \
--disable-libfdkaac \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
\
`#Options` \
--disable-avahi \
--disable-dbus_1 \
--disable-bintray_cache \
--disable-execinfo \
--disable-hdhomerun_static \
--enable-hdhomerun_client \
--enable-libav \
--enable-pngquant \
--enable-trace \
--enable-vaapi \
--infodir=/usr/share/info \
--localstatedir=/var \
--mandir=/usr/share/man \
--prefix=/usr \
--python=python3 \
--sysconfdir=/config && \
make -j 2 && \
make DESTDIR=/tmp/tvheadend-build install
RUN \
echo "**** compile argtable2 ****" && \
ARGTABLE_VER1="${ARGTABLE_VER//./-}" && \
mkdir -p \
/tmp/argtable && \
curl -s -o \
/tmp/argtable-src.tar.gz -L \
"https://sourceforge.net/projects/argtable/files/argtable/argtable-${ARGTABLE_VER}/argtable${ARGTABLE_VER1}.tar.gz" && \
tar xf \
/tmp/argtable-src.tar.gz -C \
/tmp/argtable --strip-components=1 && \
cp /tmp/patches/config.* /tmp/argtable && \
cd /tmp/argtable && \
./configure \
--prefix=/usr && \
make -j 2 && \
make check && \
make DESTDIR=/tmp/argtable-build install && \
echo "**** copy to /usr for comskip dependency ****" && \
cp -pr /tmp/argtable-build/usr/* /usr/
RUN \
echo "***** compile comskip ****" && \
git clone https://github.com/erikkaashoek/Comskip /tmp/comskip && \
cd /tmp/comskip && \
./autogen.sh && \
./configure \
--bindir=/usr/bin \
--sysconfdir=/config/comskip && \
make -j 2 && \
make DESTDIR=/tmp/comskip-build install
RUN \
echo "***** extract picons ****" && \
mkdir -p /picons && \
tar xf \
/picons.tar.bz2 -C \
/picons
############## runtime stage ##############
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="saarg"
# environment settings
ENV HOME="/config"
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
bsd-compat-headers \
ffmpeg \
ffmpeg4-libavcodec \
ffmpeg4-libavdevice \
ffmpeg4-libavfilter \
ffmpeg4-libavformat \
ffmpeg4-libavutil \
ffmpeg4-libpostproc \
ffmpeg4-libswresample \
ffmpeg4-libswscale \
gnu-libiconv \
libdvbcsa \
libhdhomerun-libs \
libva \
libva-intel-driver \
intel-media-driver \
libvpx \
libxml2 \
libxslt \
linux-headers \
mesa-va-gallium \
opus \
pcre2 \
perl \
perl-datetime-format-strptime \
perl-json \
perl-json-xs \
py3-requests \
python3 \
uriparser \
x264 \
x265 \
xmltv \
zlib && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version
# copy local files and buildstage artifacts
COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
COPY --from=buildstage /tmp/comskip-build/usr/ /usr/
COPY --from=buildstage /tmp/tvheadend-build/usr/ /usr/
COPY --from=buildstage /picons /picons
COPY root/ /
# ports and volumes
EXPOSE 9981 9982
VOLUME /config