forked from home-assistant/addons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
86 lines (78 loc) · 2.67 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
ARG BUILD_FROM
FROM $BUILD_FROM
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install packages
RUN apt-get update \
&& mkdir -p /usr/share/man/man1 \
&& apt-get install -y --no-install-recommends \
libusb-1.0 \
lighttpd \
openjdk-11-jre-headless \
&& rm -rf /var/lib/apt/lists/*
ARG OCCU_VERSION
ARG BUILD_ARCH
# Install OCCU
WORKDIR /usr/src
RUN curl -SL https://github.com/jens-maus/occu/archive/${OCCU_VERSION}.tar.gz | tar xzf - \
&& cd occu-${OCCU_VERSION} \
&& mkdir -p \
/boot \
/opt/hm \
/opt/hm/etc/config \
/opt/HmIP \
/opt/HMServer \
/var/status \
\
&& echo "VERSION=${OCCU_VERSION}" > /boot/VERSION \
&& cp /boot/VERSION /VERSION \
&& ln -s /opt/hm/etc/config /etc/config \
\
&& if [ "${BUILD_ARCH}" = "armv7" ]; \
then \
cd arm-gnueabihf-gcc8; \
else \
cd X86_32_GCC8; \
fi \
\
&& cp -R packages-eQ-3/RFD/bin /opt/hm/ \
&& cp -R packages-eQ-3/RFD/lib /opt/hm/ \
&& cp -R packages-eQ-3/LinuxBasis/bin /opt/hm/ \
&& cp -R packages-eQ-3/LinuxBasis/lib /opt/hm/ \
&& cp -R packages-eQ-3/HS485D/bin /opt/hm/ \
&& cp -R packages-eQ-3/HS485D/lib /opt/hm/ \
\
&& cp -R packages-eQ-3/WebUI/bin /opt/hm/ \
&& cp -R packages-eQ-3/WebUI/lib /opt/hm/ \
&& rm -rf packages-eQ-3/WebUI/etc/config* packages-eQ-3/WebUI/ect/rega.conf \
&& mv /opt/hm/bin/ReGaHss.normal /opt/hm/bin/ReGaHss \
&& rm -f /opt/hm/bin/ReGaHss.* \
&& cp -R packages-eQ-3/WebUI/etc/* /opt/hm/etc/ \
&& cp -R packages/lighttpd/etc/lighttpd /opt/hm/etc/ \
&& sed -i "s|/etc/lighttpd/||" /opt/hm/etc/lighttpd/conf.d/proxy.conf \
\
&& cd ../ \
&& cp -r firmware / \
&& cp -R HMserver/opt/HmIP/* /opt/HmIP/ \
&& cp -a HMserver/opt/HMServer/*.jar /opt/HMServer/ \
&& cp -R HMserver/opt/HMServer/groups /opt/HMServer/ \
&& cp -R HMserver/opt/HMServer/measurement /opt/HMServer/ \
&& cp -R HMserver/opt/HMServer/pages /opt/HMServer/ \
\
&& sed -i "s/WEBUI_VERSION = \".*\"/WEBUI_VERSION = \"${OCCU_VERSION}\"/" WebUI/www/rega/pages/index.htm \
&& cp -R WebUI/* / \
&& ln -s /www /opt/hm/www \
\
&& touch /opt/hm/etc/config/userAckSecurityHint \
&& touch /opt/hm/etc/config/firewallConfigured \
&& touch /opt/hm/etc/config/legacyAPIMigrationAccepted \
\
&& rm -rf /usr/src/occu-${OCCU_VERSION}
ENV HM_HOME=/opt/hm LD_LIBRARY_PATH=/opt/hm/lib:${LD_LIBRARY_PATH}
# Update config files
COPY data/config/* /opt/hm/etc/config/
# Setup start script
COPY data/run.sh /
COPY data/hm-firmware.sh data/hm-interface.sh /usr/lib/
WORKDIR /data
CMD [ "/run.sh" ]