This repository has been archived by the owner on Jun 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
194 lines (178 loc) · 3.98 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
ARG UBUNTU_VER="bionic"
FROM lsiobase/ubuntu.armhf:${UBUNTU_VER} as buildstage
############## build stage ##############
# package versions
ARG KODI_NAME="Leia"
ARG KODI_VER="18.2"
# defines which addons to build
ARG KODI_ADDONS="vfs.libarchive vfs.rar"
# environment settings
ARG DEBIAN_FRONTEND="noninteractive"
# copy patches and excludes
COPY patches/ /patches/
# install build packages
RUN \
apt-get update && \
apt-get install -y \
autoconf \
automake \
autopoint \
binutils \
cmake \
curl \
default-jre \
g++ \
gawk \
gcc \
git \
gperf \
libass-dev \
libavahi-client-dev \
libavahi-common-dev \
libbluray-dev \
libbz2-dev \
libcurl4-openssl-dev \
libegl1-mesa-dev \
libflac-dev \
libfmt-dev \
libfreetype6-dev \
libfstrcmp-dev \
libgif-dev \
libglew-dev \
libiso9660-dev \
libjpeg-dev \
liblcms2-dev \
liblzo2-dev \
libmicrohttpd-dev \
libmysqlclient-dev \
libnfs-dev \
libpcre3-dev \
libplist-dev \
libsmbclient-dev \
libsqlite3-dev \
libssl-dev \
libtag1-dev \
libtiff5-dev \
libtinyxml-dev \
libtool \
libvorbis-dev \
libxrandr-dev \
libxslt-dev \
make \
nasm \
python-dev \
rapidjson-dev \
swig \
uuid-dev \
yasm \
zip \
zlib1g-dev
# fetch source and apply any required patches
RUN \
set -ex && \
mkdir -p \
/tmp/kodi-source/build && \
curl -o \
/tmp/kodi.tar.gz -L \
"https://github.com/xbmc/xbmc/archive/${KODI_VER}-${KODI_NAME}.tar.gz" && \
tar xf /tmp/kodi.tar.gz -C \
/tmp/kodi-source --strip-components=1 && \
cd /tmp/kodi-source && \
git apply \
/patches/"${KODI_NAME}"/headless.patch
# build package
RUN \
cd /tmp/kodi-source/build && \
cmake ../. \
# this block is only for armhf builds
-DCMAKE_C_FLAGS="-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mvectorize-with-neon-quad" \
-DCMAKE_CXX_FLAGS="-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mvectorize-with-neon-quad" \
# comment everything out in the block for non-armhf builds
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_AIRTUNES=OFF \
-DENABLE_ALSA=OFF \
-DENABLE_AVAHI=OFF \
-DENABLE_BLUETOOTH=OFF \
-DENABLE_BLURAY=ON \
-DENABLE_CAP=OFF \
-DENABLE_CEC=OFF \
-DENABLE_DBUS=OFF \
-DENABLE_DVDCSS=OFF \
-DENABLE_GLX=OFF \
-DENABLE_INTERNAL_FLATBUFFERS=ON \
-DENABLE_LIBUSB=OFF \
-DENABLE_NFS=ON \
-DENABLE_OPENGL=OFF \
-DENABLE_OPTICAL=OFF \
-DENABLE_PULSEAUDIO=OFF \
-DENABLE_SNDIO=OFF \
-DENABLE_UDEV=OFF \
-DENABLE_UPNP=ON \
-DENABLE_VAAPI=OFF \
-DENABLE_VDPAU=OFF && \
make -j3 && \
make DESTDIR=/tmp/kodi-build install
# build kodi addons
RUN \
set -ex && \
cd /tmp/kodi-source && \
make -j3 \
-C tools/depends/target/binary-addons \
ADDONS="$KODI_ADDONS" \
PREFIX=/tmp/kodi-build/usr
# install kodi send
RUN \
install -Dm755 \
/tmp/kodi-source/tools/EventClients/Clients/KodiSend/kodi-send.py \
/usr/bin/kodi-send && \
install -Dm644 \
/tmp/kodi-source/tools/EventClients/lib/python/xbmcclient.py \
/usr/lib/python2.7/xbmcclient.py
FROM lsiobase/ubuntu.armhf:${UBUNTU_VER}
############## runtime stage ##############
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="sparklyballs"
# environment settings
ARG DEBIAN_FRONTEND="noninteractive"
ENV HOME="/config"
# install runtime packages
RUN \
apt-get update && \
apt-get install -y \
--no-install-recommends \
libass9 \
libbluray2 \
libegl1 \
libfstrcmp0 \
libgl1 \
liblcms2-2 \
liblzo2-2 \
libmicrohttpd12 \
libmysqlclient20 \
libnfs11 \
libpcrecpp0v5 \
libpython2.7 \
libsmbclient \
libtag1v5 \
libtinyxml2.6.2v5 \
libxrandr2 \
libxslt1.1 && \
\
# cleanup
\
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# copy local files and artifacts of build stages.
COPY root/ /
COPY --from=buildstage /tmp/kodi-build/usr/ /usr/
COPY --from=buildstage /usr/bin/kodi-send /usr/bin/kodi-send
COPY --from=buildstage /usr/lib/python2.7/xbmcclient.py /usr/lib/python2.7/xbmcclient.py
# ports and volumes
VOLUME /config/.kodi
EXPOSE 8080 9090 9777/udp