Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit e6336b5

Browse files
authored
Merge pull request #36 from linuxserver/pipeline
Pipeline logic and multi arch
2 parents 24a99d7 + 08d17e5 commit e6336b5

File tree

8 files changed

+1187
-84
lines changed

8 files changed

+1187
-84
lines changed

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
FROM lsiobase/alpine:3.7
1+
FROM lsiobase/alpine:3.8
22

33
# set version label
44
ARG BUILD_DATE
55
ARG VERSION
6+
ARG DOMOTICZ_COMMIT
67
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
78
LABEL maintainer="saarg"
89

@@ -29,6 +30,7 @@ RUN \
2930
gcc \
3031
git \
3132
gzip \
33+
jq \
3234
libcurl \
3335
libftdi1-dev \
3436
libressl-dev \
@@ -84,8 +86,13 @@ RUN \
8486
sysconfdir=etc/openzwave \
8587
install && \
8688
echo "**** build domoticz ****" && \
89+
if [ -z ${DOMOTICZ_COMMIT+x} ]; then \
90+
DOMOTICZ_COMMIT=$(curl -sX GET https://api.github.com/repos/domoticz/domoticz/commits/master \
91+
| jq -r '. | .sha'); \
92+
fi && \
8793
git clone https://github.com/domoticz/domoticz.git /tmp/domoticz && \
8894
cd /tmp/domoticz && \
95+
git checkout ${DOMOTICZ_COMMIT} && \
8996
cmake \
9097
-DBUILD_SHARED_LIBS=True \
9198
-DCMAKE_BUILD_TYPE=Release \

Dockerfile.aarch64

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
FROM lsiobase/alpine.arm64:3.8
2+
3+
# Add qemu to build on x86_64 systems
4+
COPY qemu-aarch64-static /usr/bin
5+
6+
# set version label
7+
ARG BUILD_DATE
8+
ARG VERSION
9+
ARG DOMOTICZ_COMMIT
10+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
11+
LABEL maintainer="saarg"
12+
13+
# environment settings
14+
ENV HOME="/config"
15+
16+
# copy prebuilds
17+
COPY patches/ /
18+
19+
RUN \
20+
echo "**** install build packages ****" && \
21+
apk add --no-cache --virtual=build-dependencies \
22+
argp-standalone \
23+
autoconf \
24+
automake \
25+
binutils \
26+
boost-dev \
27+
cmake \
28+
confuse-dev \
29+
curl-dev \
30+
doxygen \
31+
eudev-dev \
32+
g++ \
33+
gcc \
34+
git \
35+
gzip \
36+
jq \
37+
libcurl \
38+
libftdi1-dev \
39+
libressl-dev \
40+
libusb-compat-dev \
41+
libusb-dev \
42+
linux-headers \
43+
lua5.2-dev \
44+
make \
45+
mosquitto-dev \
46+
musl-dev \
47+
pkgconf \
48+
sqlite-dev \
49+
tar \
50+
zlib-dev && \
51+
echo "**** install runtime packages ****" && \
52+
apk add --no-cache \
53+
curl \
54+
eudev-libs \
55+
libressl \
56+
openssh \
57+
python3-dev && \
58+
echo "**** link libftdi libs ****" && \
59+
ln -s /usr/lib/libftdi1.so /usr/lib/libftdi.so && \
60+
ln -s /usr/lib/libftdi1.a /usr/lib/libftdi.a && \
61+
ln -s /usr/include/libftdi1/ftdi.h /usr/include/ftdi.h && \
62+
echo "**** build telldus-core ****" && \
63+
mkdir -p \
64+
/tmp/telldus-core && \
65+
tar xf /tmp/patches/telldus-core-2.1.2.tar.gz -C \
66+
/tmp/telldus-core --strip-components=1 && \
67+
curl -o /tmp/telldus-core/Doxyfile.in -L \
68+
https://raw.githubusercontent.com/telldus/telldus/master/telldus-core/Doxyfile.in && \
69+
cp /tmp/patches/Socket_unix.cpp /tmp/telldus-core/common/Socket_unix.cpp && \
70+
cp /tmp/patches/ConnectionListener_unix.cpp /tmp/telldus-core/service/ConnectionListener_unix.cpp && \
71+
cp /tmp/patches/CMakeLists.txt /tmp/telldus-core/CMakeLists.txt && \
72+
cd /tmp/telldus-core && \
73+
cmake -DBUILD_TDADMIN=false -DCMAKE_INSTALL_PREFIX=/tmp/telldus-core . && \
74+
make && \
75+
echo "**** configure telldus core ****" && \
76+
mv /tmp/telldus-core/client/libtelldus-core.so.2.1.2 /usr/lib/libtelldus-core.so.2.1.2 && \
77+
mv /tmp/telldus-core/client/telldus-core.h /usr/include/telldus-core.h && \
78+
ln -s /usr/lib/libtelldus-core.so.2.1.2 /usr/lib/libtelldus-core.so.2 && \
79+
ln -s /usr/lib/libtelldus-core.so.2 /usr/lib/libtelldus-core.so && \
80+
echo "**** build openzwave ****" && \
81+
git clone https://github.com/OpenZWave/open-zwave.git /tmp/open-zwave && \
82+
ln -s /tmp/open-zwave /tmp/open-zwave-read-only && \
83+
cd /tmp/open-zwave && \
84+
make && \
85+
make \
86+
instlibdir=usr/lib \
87+
pkgconfigdir="usr/lib/pkgconfig/" \
88+
PREFIX=/usr \
89+
sysconfdir=etc/openzwave \
90+
install && \
91+
echo "**** build domoticz ****" && \
92+
if [ -z ${DOMOTICZ_COMMIT+x} ]; then \
93+
DOMOTICZ_COMMIT=$(curl -sX GET https://api.github.com/repos/domoticz/domoticz/commits/master \
94+
| jq -r '. | .sha'); \
95+
fi && \
96+
git clone https://github.com/domoticz/domoticz.git /tmp/domoticz && \
97+
cd /tmp/domoticz && \
98+
git checkout ${DOMOTICZ_COMMIT} && \
99+
cmake \
100+
-DBUILD_SHARED_LIBS=True \
101+
-DCMAKE_BUILD_TYPE=Release \
102+
-DCMAKE_INSTALL_PREFIX=/var/lib/domoticz \
103+
-DOpenZWave=/usr/lib/libopenzwave.so \
104+
-DUSE_BUILTIN_LUA=OFF \
105+
-DUSE_BUILTIN_MQTT=OFF \
106+
-DUSE_BUILTIN_SQLITE=OFF \
107+
-DUSE_STATIC_LIBSTDCXX=OFF \
108+
-DUSE_STATIC_OPENZWAVE=OFF \
109+
-Wno-dev && \
110+
make && \
111+
make install && \
112+
echo "**** install BroadlinkRM2 plugin dependencies ****" && \
113+
git clone https://github.com/mjg59/python-broadlink.git /tmp/python-broadlink && \
114+
cd /tmp/python-broadlink && \
115+
git checkout 8bc67af6 && \
116+
pip3 install --no-cache-dir . && \
117+
pip3 install --no-cache-dir pyaes && \
118+
echo "**** determine runtime packages using scanelf ****" && \
119+
RUNTIME_PACKAGES="$( \
120+
scanelf --needed --nobanner /var/lib/domoticz/domoticz \
121+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
122+
| sort -u \
123+
| xargs -r apk info --installed \
124+
| sort -u \
125+
)" && \
126+
apk add --no-cache \
127+
$RUNTIME_PACKAGES && \
128+
echo "**** add abc to dialout and cron group ****" && \
129+
usermod -a -G 16,20 abc && \
130+
echo " **** cleanup ****" && \
131+
apk del --purge \
132+
build-dependencies && \
133+
rm -rf \
134+
/tmp/* \
135+
/usr/lib/libftdi* \
136+
/usr/include/ftdi.h
137+
138+
# copy local files
139+
COPY root/ /
140+
141+
# ports and volumes
142+
EXPOSE 8080 6144 1443
143+
VOLUME /config

Dockerfile.armhf

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
FROM lsiobase/alpine.armhf:3.8
2+
3+
# Add qemu to build on x86_64 systems
4+
COPY qemu-arm-static /usr/bin
5+
6+
# set version label
7+
ARG BUILD_DATE
8+
ARG VERSION
9+
ARG DOMOTICZ_COMMIT
10+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
11+
LABEL maintainer="saarg"
12+
13+
# environment settings
14+
ENV HOME="/config"
15+
16+
# copy prebuilds
17+
COPY patches/ /
18+
19+
RUN \
20+
echo "**** install build packages ****" && \
21+
apk add --no-cache --virtual=build-dependencies \
22+
argp-standalone \
23+
autoconf \
24+
automake \
25+
binutils \
26+
boost-dev \
27+
cmake \
28+
confuse-dev \
29+
curl-dev \
30+
doxygen \
31+
eudev-dev \
32+
g++ \
33+
gcc \
34+
git \
35+
gzip \
36+
jq \
37+
libcurl \
38+
libftdi1-dev \
39+
libressl-dev \
40+
libusb-compat-dev \
41+
libusb-dev \
42+
linux-headers \
43+
lua5.2-dev \
44+
make \
45+
mosquitto-dev \
46+
musl-dev \
47+
pkgconf \
48+
sqlite-dev \
49+
tar \
50+
zlib-dev && \
51+
echo "**** install runtime packages ****" && \
52+
apk add --no-cache \
53+
curl \
54+
eudev-libs \
55+
libressl \
56+
openssh \
57+
python3-dev && \
58+
echo "**** link libftdi libs ****" && \
59+
ln -s /usr/lib/libftdi1.so /usr/lib/libftdi.so && \
60+
ln -s /usr/lib/libftdi1.a /usr/lib/libftdi.a && \
61+
ln -s /usr/include/libftdi1/ftdi.h /usr/include/ftdi.h && \
62+
echo "**** build telldus-core ****" && \
63+
mkdir -p \
64+
/tmp/telldus-core && \
65+
tar xf /tmp/patches/telldus-core-2.1.2.tar.gz -C \
66+
/tmp/telldus-core --strip-components=1 && \
67+
curl -o /tmp/telldus-core/Doxyfile.in -L \
68+
https://raw.githubusercontent.com/telldus/telldus/master/telldus-core/Doxyfile.in && \
69+
cp /tmp/patches/Socket_unix.cpp /tmp/telldus-core/common/Socket_unix.cpp && \
70+
cp /tmp/patches/ConnectionListener_unix.cpp /tmp/telldus-core/service/ConnectionListener_unix.cpp && \
71+
cp /tmp/patches/CMakeLists.txt /tmp/telldus-core/CMakeLists.txt && \
72+
cd /tmp/telldus-core && \
73+
cmake -DBUILD_TDADMIN=false -DCMAKE_INSTALL_PREFIX=/tmp/telldus-core . && \
74+
make && \
75+
echo "**** configure telldus core ****" && \
76+
mv /tmp/telldus-core/client/libtelldus-core.so.2.1.2 /usr/lib/libtelldus-core.so.2.1.2 && \
77+
mv /tmp/telldus-core/client/telldus-core.h /usr/include/telldus-core.h && \
78+
ln -s /usr/lib/libtelldus-core.so.2.1.2 /usr/lib/libtelldus-core.so.2 && \
79+
ln -s /usr/lib/libtelldus-core.so.2 /usr/lib/libtelldus-core.so && \
80+
echo "**** build openzwave ****" && \
81+
git clone https://github.com/OpenZWave/open-zwave.git /tmp/open-zwave && \
82+
ln -s /tmp/open-zwave /tmp/open-zwave-read-only && \
83+
cd /tmp/open-zwave && \
84+
make && \
85+
make \
86+
instlibdir=usr/lib \
87+
pkgconfigdir="usr/lib/pkgconfig/" \
88+
PREFIX=/usr \
89+
sysconfdir=etc/openzwave \
90+
install && \
91+
echo "**** build domoticz ****" && \
92+
if [ -z ${DOMOTICZ_COMMIT+x} ]; then \
93+
DOMOTICZ_COMMIT=$(curl -sX GET https://api.github.com/repos/domoticz/domoticz/commits/master \
94+
| jq -r '. | .sha'); \
95+
fi && \
96+
git clone https://github.com/domoticz/domoticz.git /tmp/domoticz && \
97+
cd /tmp/domoticz && \
98+
git checkout ${DOMOTICZ_COMMIT} && \
99+
cmake \
100+
-DBUILD_SHARED_LIBS=True \
101+
-DCMAKE_BUILD_TYPE=Release \
102+
-DCMAKE_INSTALL_PREFIX=/var/lib/domoticz \
103+
-DOpenZWave=/usr/lib/libopenzwave.so \
104+
-DUSE_BUILTIN_LUA=OFF \
105+
-DUSE_BUILTIN_MQTT=OFF \
106+
-DUSE_BUILTIN_SQLITE=OFF \
107+
-DUSE_STATIC_LIBSTDCXX=OFF \
108+
-DUSE_STATIC_OPENZWAVE=OFF \
109+
-Wno-dev && \
110+
make && \
111+
make install && \
112+
echo "**** install BroadlinkRM2 plugin dependencies ****" && \
113+
git clone https://github.com/mjg59/python-broadlink.git /tmp/python-broadlink && \
114+
cd /tmp/python-broadlink && \
115+
git checkout 8bc67af6 && \
116+
pip3 install --no-cache-dir . && \
117+
pip3 install --no-cache-dir pyaes && \
118+
echo "**** determine runtime packages using scanelf ****" && \
119+
RUNTIME_PACKAGES="$( \
120+
scanelf --needed --nobanner /var/lib/domoticz/domoticz \
121+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
122+
| sort -u \
123+
| xargs -r apk info --installed \
124+
| sort -u \
125+
)" && \
126+
apk add --no-cache \
127+
$RUNTIME_PACKAGES && \
128+
echo "**** add abc to dialout and cron group ****" && \
129+
usermod -a -G 16,20 abc && \
130+
echo " **** cleanup ****" && \
131+
apk del --purge \
132+
build-dependencies && \
133+
rm -rf \
134+
/tmp/* \
135+
/usr/lib/libftdi* \
136+
/usr/include/ftdi.h
137+
138+
# copy local files
139+
COPY root/ /
140+
141+
# ports and volumes
142+
EXPOSE 8080 6144 1443
143+
VOLUME /config

0 commit comments

Comments
 (0)