-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (53 loc) · 1.78 KB
/
Dockerfile
File metadata and controls
74 lines (53 loc) · 1.78 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
# docker build -t client_interface -f Dockerfile .
# docker run -p 1883:1883 client_interface
FROM debian:latest
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#install required sw
RUN apt-get -y update
RUN apt-get -y upgrade
#&& apt-get install -y apt-transport-https
RUN apt-get -y install git build-essential gcc pkg-config cmake check python3
#clone open62541 library and init submodules
RUN git clone https://github.com/open62541/open62541
WORKDIR /open62541/
RUN git fetch --all --tags
RUN git checkout tags/v1.4.6 -b v1.4.6-branch
RUN git submodule update --init --recursive
#install open62541
RUN mkdir build
WORKDIR /open62541/build
RUN cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_NAMESPACE_ZERO=FULL -DUA_ENABLE_JSON_ENCODING=ON ..
RUN make -j6 install
RUN cd ..
WORKDIR /
#clone the swap-it-server-template
RUN git clone https://github.com/FlorianDue/swap-it-open62541-server-template
WORKDIR /swap-it-open62541-server-template/
RUN git checkout order_queue
RUN mkdir build
WORKDIR /swap-it-open62541-server-template/build
RUN cmake ..
RUN make install
WORKDIR /
RUN git clone https://github.com/LiamBindle/MQTT-C.git
WORKDIR /MQTT-C/
RUN mkdir build
WORKDIR /MQTT-C/build
RUN cmake ..
RUN make install
WORKDIR /
#create a folder for the server and copy the required files into it
WORKDIR client_interface
COPY configs /client_interface/configs
COPY main.c /client_interface/main.c
COPY model/. /client_interface/model
COPY include/. /client_interface/include/
COPY src/. /client_interface/src/
COPY CMakeLists.txt /client_interface/CMakeLists.txt
WORKDIR build
#build the server
RUN cmake ..
RUN make
EXPOSE 1883 8181
CMD ["./client_interface"]