-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-avahi
74 lines (64 loc) · 3.62 KB
/
Dockerfile-avahi
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
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ build-essential openssl libssl-dev unzip git wget dbus avahi-daemon libavahi-compat-libdnssd-dev && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean -y --no-install-recommends
## Get and Make CMake version 3.11.2 (latest when Dockerfile developed) - Adjust as necessary
RUN cd /home/ && wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.2.tar.gz && \
tar xvf cmake-3.11.2.tar.gz && rm cmake-3.11.2.tar.gz && cd /home/cmake-3.11.2 && \
./bootstrap && make && make install
## Get and Make Boost 1.67.0 (latest when Dockerfile developed) - Adjust as necessary
RUN cd /home/ && wget --no-check-certificate https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz && \
tar xvf boost_1_67_0.tar.gz && rm boost_1_67_0.tar.gz && cd /home/boost_1_67_0 && \
./bootstrap.sh b2 --with-toolset=gcc --with-libraries=date_time,regex,system,thread,random,filesystem,chrono,atomic \
--prefix=. && ./b2
## Get source for Sony nmos-cpp
RUN cd /home/ && git init && git config --global http.sslVerify false && \
git clone https://github.com/sony/nmos-cpp.git
## You should use either Avahi or Apple mDNS - DO NOT use both
##
## mDNSResponder 878.30.4
#RUN cd /home/ && wget --no-check-certificate https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.30.4.tar.gz && \
# tar xvf mDNSResponder-878.30.4.tar.gz && rm mDNSResponder-878.30.4.tar.gz && \
# patch -d mDNSResponder-878.30.4/ -p1 <nmos-cpp/Development/third_party/mDNSResponder/poll-rather-than-select.patch && \
# cd /home/mDNSResponder-878.30.4/mDNSPosix && set HAVE_IPV6=0 && make os=linux && make os=linux install
#Get and Make Microsft C++ REST SDK v2.10.2 from Sony Archive
RUN cd /home/ && wget --no-check-certificate https://github.com/garethsb-sony/cpprestsdk/archive/v2.10.2-nmos-cpp.zip && \
unzip v2.10.2-nmos-cpp.zip && rm v2.10.2-nmos-cpp.zip && \
mkdir /home/cpprestsdk-2.10.2-nmos-cpp/Release/build && \
cd /home/cpprestsdk*/Release/build && \
cmake .. \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DWERROR:BOOL="0" \
-DBOOST_INCLUDEDIR:PATH="/home/boost_1_67_0" \
-DBOOST_LIBRARYDIR:PATH="/home/boost_1_67_0/x64/lib" \
-DOPENSSL_ROOT_DIR="/usr/lib/x86_64-linux-gnu" \
-DOPENSSL_LIBRARIES="/usr/lib/x86_64-linux-gnu" && \
make && \
make install
#Build nmos-cpp from source
RUN mkdir /home/nmos-cpp/Development/build && \
cd /home/nmos-cpp/Development/build && \
cmake \
-G "Unix Makefiles" \
-DCMAKE_CONFIGURATION_TYPES:STRING="Debug;Release" \
-DBoost_USE_STATIC_LIBS:BOOL="1" \
-DBOOST_INCLUDEDIR:PATH="/home/boost_1_67_0" \
-DBOOST_LIBRARYDIR:PATH="/home/boost_1_67_0/x64/lib" \
-DWEBSOCKETPP_INCLUDE_DIR:PATH="/home/cpprestsdk-2.10.2-nmos-cpp/Release/libs/websocketpp" \
-DCPPREST_INCLUDE_DIR:PATH="/home/cpprestsdk-2.10.2-nmos-cpp/" \
-build /home/nmos-cpp/Development/build .. && \
make
#Move executables, libraries and clean up container as much as possible
RUN cd /home/nmos-cpp/Development/build && \
cp nmos-cpp-node nmos-cpp-registry nmos-cpp-registry-test /home && \
cp /home/boost_1_67_0/stage/lib/* /usr/local/lib && \
cd /home/cmake-3.11.2 && make uninstall && \
cd /home && rm -rf cmake-3.11.2 mDNSResponder-878.30.4 boost_1_67_0 cpprestsdk-2.10.2-nmos-cpp nmos-cpp && \
apt-get remove g++ build-essential unzip git wget -y --no-install-recommends
#Add Entrypoint.sh script to make container executable
ADD entrypoint.sh /home/entrypoint.sh
RUN chmod +x /home/entrypoint.sh
#WORKDIR /home/
#ENTRYPOINT ["/home/entrypoint.sh"]
#CMD []