-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
163 lines (124 loc) · 5.46 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
############################################################
# Dockerfile to build OpenZWave Library container images
# Based on CentOS7
############################################################
ARG distcchosts=''
ARG concurrency="12"
ARG qtversion="5.12.9"
# Set the base image to Alpine
FROM fishwaldo/ozw-base:${qtversion} as builder
# File Author / Maintainer
LABEL maintainer="[email protected]"
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /opt
#RUN echo 'APT::Default-Release "stable";' > /etc/apt/apt.conf.d/99defaultrelease \
# && echo 'deb http://ftp.debian.org/debian/ unstable main contrib non-free' > /etc/apt/sources.list.d/unstable.list \
# && apt update
RUN apt update && apt-get -y install rapidjson-dev cmake pkgconf python libunwind-dev libcurl4-openssl-dev libx11-dev libglu1-mesa-dev libexecline-dev
ARG distcchosts=''
ARG concurrency="12"
ARG qtversion="5.12.9"
ENV DISTCC_HOSTS="$distcchosts"
RUN if [ -n "${DISTCC_HOSTS}" ]; then cd /usr/local/bin; ln /usr/bin/distcc gcc; ln /usr/bin/distcc g++; echo "Using DistCC hosts ${DISTCC_HOSTS}"; fi
ENV PATH=$PATH:/opt/depot_tools/
ENV DEPOT_TOOLS_UPDATE=0
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git \
&& cd depot_tools && git checkout 464e9ff && cd .. \
&& mkdir breakpad \
&& cd breakpad \
&& fetch breakpad \
&& cd src \
&& ./configure --disable-processor --disable-tools \
&& make -j${concurrency} \
&& make install
RUN git clone https://github.com/OpenZWave/open-zwave.git \
&& cd open-zwave \
&& make -j${concurrency} \
&& make install instlibdir=/usr/local/lib/
COPY .qmake.conf /opt/qt-openzwave/
COPY qt-openzwave /opt/qt-openzwave/qt-openzwave
COPY qt-openzwave.pri /opt/qt-openzwave/
COPY qt-openzwave.pro /opt/qt-openzwave/
COPY qt-openzwavedatabase /opt/qt-openzwave/qt-openzwavedatabase
COPY qt-ozwdaemon /opt/qt-openzwave/qt-ozwdaemon
COPY qt-openzwave.pro /opt/qt-openzwave/
ARG BP_CLIENTID
ARG BP_CLIENTKEY
ARG BUILDNUMBER=0
RUN cd qt-openzwave \
&& if [ -f Makefile ]; then qmake -r; make distclean; fi \
&& qmake -r CONFIG+=release "BP_CLIENTID=$BP_CLIENTID" "BP_CLIENTKEY=$BP_CLIENTKEY" "BUILDNUMBER=$BUILDNUMBER" \
&& make -j${concurrency} \
&& make install
RUN git clone https://github.com/OpenZWave/ozw-admin.git \
&& cd ozw-admin \
&& if [ -f Makefile ]; then qmake -r; make distclean; fi \
&& qmake -r CONFIG+=release \
&& make -j${concurrency} \
&& make install
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
FROM debian:buster-slim as base
ARG qtversion="5.12.9"
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
LABEL maintainer="[email protected]"
WORKDIR /opt
RUN apt update \
&& apt-get -y install libunwind8 libcurl4 binutils libglib2.0-0 libicu63 wget \
&& apt-get -y purge binutils \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN case `uname -m` in x86_64) var="amd64";; armhf) var="armhf";; armv7l) var="armhf";; aarch64) var="aarch64";; esac && wget https://github.com/just-containers/s6-overlay/releases/download/v2.0.0.1/s6-overlay-$var.tar.gz -O /tmp/s6-overlay.tar.gz \
&& tar xzf /tmp/s6-overlay.tar.gz -C / \
&& rm /tmp/s6-overlay.tar.gz
COPY --from=builder /usr/local/bin/ozwdaemon /usr/local/bin/s6* /usr/local/bin/
COPY --from=builder /usr/local/lib/libopenzwave.so.1.6 /usr/local/lib/
COPY --from=builder /opt/qt/${qtversion}/lib/libQt5Core* /opt/qt/${qtversion}/lib/libQt5Network* /opt/qt/${qtversion}/lib/libQt5Mqtt* /opt/qt/${qtversion}/lib/libQt5WebSockets* /opt/qt/${qtversion}/lib/libQt5RemoteObjects* /opt/qt/${qtversion}/lib/
COPY --from=builder /opt/qt/${qtversion}/lib/libqt-openzwave* /opt/qt/${qtversion}/lib/
COPY --from=builder /opt/qt/${qtversion}/qt-openzwavedatabase.rcc /opt/qt/${qtversion}/
COPY Docker/base/ /
RUN ldconfig -v
ENV BP_DB_PATH="/opt/ozw/config/crashes/"
ENV S6_LOGGING_SCRIPT="n20 s10000000 T"
WORKDIR /opt/ozw/
EXPOSE 1983
VOLUME ["/opt/ozw/config/"]
ENTRYPOINT ["/init"]
FROM base as allinone
ARG qtversion="5.12.9"
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
ADD https://github.com/novnc/websockify/archive/v0.9.0.tar.gz /opt/source/
ADD https://github.com/novnc/noVNC/archive/v1.2.0.tar.gz /opt/source/
RUN apt update \
&& apt-get -y install libgl1 libpng16-16 libharfbuzz0b libfontconfig1 libmtdev1 libinput10 libxkbcommon0 libdbus-1-3 python3-setuptools python3-numpy \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& cd /opt/source/ \
&& tar -xzvf v0.9.0.tar.gz \
&& cd websockify-0.9.0 \
&& python3 setup.py install \
&& cd /opt/source/ \
&& tar -xzvf v1.2.0.tar.gz \
&& cp -R /opt/source/noVNC-1.2.0/ /opt/novnc/ \
&& rm -rf /opt/source/*
COPY --from=builder /usr/local/bin/ozwadmin /usr/local/bin/
COPY --from=builder /opt/qt/${qtversion}/lib/libQt5Svg* /opt/qt/${qtversion}/lib/libQt5Widgets* /opt/qt/${qtversion}/lib/libQt5Gui* /opt/qt/${qtversion}/lib/libQt5Xml* /opt/qt/${qtversion}/lib/libQt5SerialPort* /opt/qt/${qtversion}/lib/libQt5DBus* /opt/qt/${qtversion}/lib/
COPY --from=builder /opt/qt/${qtversion}/plugins /opt/qt/${qtversion}/plugins
COPY --from=builder /opt/qt/${qtversion}/resources /opt/qt/${qtversion}/resources
COPY --from=builder /opt/qt/${qtversion}/libexec /opt/qt/${qtversion}/libexec
COPY Docker/allinone/ /
ENV BP_DB_PATH="/opt/ozw/config/crashes/"
ENV VNC_PORT=5901
ENV WEB_PORT=7800
ENV QT_ASSUME_STDERR_HAS_CONSOLE=1
ENV S6_LOGGING_SCRIPT="n20 s10000000 T"
WORKDIR /opt/ozw/
EXPOSE 1983
EXPOSE 5901
EXPOSE 7800
VOLUME ["/opt/ozw/config/"]
ENTRYPOINT ["/init"]