-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
95 lines (77 loc) · 2.85 KB
/
Dockerfile
File metadata and controls
95 lines (77 loc) · 2.85 KB
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
FROM ubuntu:18.04 as builder
MAINTAINER LDL Tools development team <ldltools@outlook.com>
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV DEBCONF_NOWARNINGS yes
RUN echo "dash dash/sh boolean false" | debconf-set-selections;\
dpkg-reconfigure -f noninteractive dash;\
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local-lib.conf
RUN apt-get update;\
apt-get install -y build-essential g++ flex bison gawk jq;\
apt-get install -y file rsync wget net-tools nmap
# Qt5
RUN apt-get install -y qt5-default qtbase5-dev qtbase5-private-dev;\
apt-get install -y qtdeclarative5-dev qtdeclarative5-private-dev
# QtSCXML
WORKDIR /root
RUN version=5.9.5;\
wget https://github.com/qt/qtscxml/archive/v${version}.tar.gz;\
tar xzf v${version}.tar.gz;\
cd qtscxml-${version}/src/scxml; qmake;\
incdir=/usr/include/x86_64-linux-gnu/qt5/QtScxml;\
mkdir -p ${incdir}/private; cp -p *.h $incdir; cp ${incdir}/*.h ${incdir}/private;\
ln -s . private;\
make && make install;\
echo "#include \"qscxmlstatemachine.h\"" > ${incdir}/QScxmlStateMachine;\
echo "#include \"qscxmlevent.h\"" > ${incdir}/QScxmlEvent;\
echo "#include \"qscxmlecmascriptdatamodel.h\"" > ${incdir}/QScxmlEcmaScriptDataModel
# JSON
RUN apt-get install -y nlohmann-json-dev
# MQTT w. the WebSocket-bridge functionality activated
RUN apt-get install -y mosquitto mosquitto-clients libmosquitto-dev;\
dir=/etc/mosquitto/conf.d; conf=${dir}/websockets.conf;\
test -d $dir -a ! -f $conf &&\
echo -e "listener 1883\nlistener 9001\nprotocol websockets" > $conf &&\
service mosquitto restart
# SCXMLRUN
ADD . /root/scxmlrun
WORKDIR /root/scxmlrun
RUN make && PREFIX=/usr/local make install
#
WORKDIR /root
CMD ["/bin/bash"]
# MQTT/Websocket ports
EXPOSE 1883
EXPOSE 9001
# ====================
# final image
# ====================
FROM ubuntu:18.04
RUN echo "dash dash/sh boolean false" | debconf-set-selections;\
dpkg-reconfigure -f noninteractive dash;\
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local-lib.conf;\
apt-get update
# Qt5
RUN apt-get install -y libqt5core5a libqt5network5 libqt5qml5
# QtSCXML
WORKDIR /usr/lib/x86_64-linux-gnu/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libQt5Scxml.so.5.9.5 .
RUN ln -s libQt5Scxml.so.5.9.5 libQt5Scxml.so.5.9;\
ln -s libQt5Scxml.so.5.9.5 libQt5Scxml.so.5;\
ln -s libQt5Scxml.so.5.9.5 libQt5Scxml.so
# MQTT
RUN apt-get install -y mosquitto mosquitto-clients;\
dir=/etc/mosquitto/conf.d; conf=${dir}/websockets.conf;\
test -d $dir -a ! -f $conf &&\
echo -e "listener 1883\nlistener 9001\nprotocol websockets" > $conf
# SCXMLRUN
COPY --from=builder /usr/local /usr/local
RUN ldconfig
# examples & tests
ADD examples /root/examples
ADD tests /root/tests
RUN apt-get install -y make gawk jq shelltestrunner
WORKDIR /root
CMD ["/bin/bash"]
# MQTT/Websocket ports
EXPOSE 1883 9001