FCA_RIC-2909
[ric-plt/e2.git] / RIC-E2-TERMINATION / Dockerfile
1 ##############################################################################
2 #
3 #   Copyright (c) 2019 AT&T Intellectual Property.
4 #
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 #
17 ##############################################################################
18
19 #
20 #   This source code is part of the near-RT RIC (RAN Intelligent Controller)
21 #   platform project (RICP).
22 #
23 FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as ubuntu
24
25 WORKDIR /opt/e2/
26
27 ARG BUILD_TYPE="Release"
28 RUN apt-get update
29 RUN apt-get install -y lcov
30 RUN mkdir -p /opt/e2/RIC-E2-TERMINATION/ \
31     && mkdir -p /opt/e2/RIC-E2-TERMINATION/TEST/T1 \
32     && mkdir -p /opt/e2/RIC-E2-TERMINATION/TEST/T2 \
33     && mkdir -p /opt/e2/RIC-E2-TERMINATION/3rdparty
34
35 COPY . /opt/e2/RIC-E2-TERMINATION/
36 RUN apt-get install -y libgtest-dev
37 RUN cd /usr/src/gtest &&  /usr/local/bin/cmake  CMakeLists.txt && make && cp *.a /usr/lib
38
39 RUN mv /opt/e2/RIC-E2-TERMINATION/CMakeLists.txt /opt/e2/ && cat /opt/e2/RIC-E2-TERMINATION/config/config.conf \
40     && wget --content-disposition https://github.com/cgreen-devs/cgreen/releases/download/1.2.0/cgreen_1.2.0_amd64.deb \
41     && dpkg -i cgreen_1.2.0_amd64.deb \
42     && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_4.7.4_amd64.deb/download.deb \
43     && dpkg -i rmr_4.7.4_amd64.deb \
44     && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_4.7.4_amd64.deb/download.deb \
45     && dpkg -i rmr-dev_4.7.4_amd64.deb \
46     && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog_0.1.1-1_amd64.deb/download.deb \
47     && dpkg -i mdclog_0.1.1-1_amd64.deb \
48     && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog-dev_0.1.1-1_amd64.deb/download.deb \
49     && dpkg -i mdclog-dev_0.1.1-1_amd64.deb \
50     && apt-get update && apt-get install -y libcurl4-gnutls-dev gawk libtbb-dev  libtbb-doc libtbb2 libtbb2-dbg \
51     && apt-get install  -y python3 python3-pip python3-setuptools python3-wheel ninja-build \
52     && pip3 install  meson \
53     && cd /opt/e2/RIC-E2-TERMINATION/3rdparty && git clone https://github.com/pistacheio/pistache.git  && cd pistache \
54     && meson setup build  \
55        --buildtype=release -DPISTACHE_USE_SSL=false -DPISTACHE_BUILD_EXAMPLES=false  -DPISTACHE_BUILD_TESTS=false \
56         -DPISTACHE_BUILD_DOCS=false  --prefix=/usr/local \
57     && meson compile -C build  && meson install -C build  && ldconfig \
58     && cd /opt/e2/RIC-E2-TERMINATION/3rdparty && git clone -v https://github.com/jupp0r/prometheus-cpp.git \
59     && cd prometheus-cpp && git submodule init && git submodule update && mkdir build && cd build \
60     && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j 4  && make install && ldconfig \
61     && cd /opt/e2/RIC-E2-TERMINATION/3rdparty && git clone https://github.com/jarro2783/cxxopts.git \
62     && cd /opt/e2/RIC-E2-TERMINATION/3rdparty && git clone https://github.com/Tencent/rapidjson.git \
63     && cd /opt/e2/RIC-E2-TERMINATION/3rdparty && git clone https://github.com/zeux/pugixml.git \
64     && cd /opt/e2/ && git clone https://github.com/bilke/cmake-modules.git \
65     && cd /opt/e2/ && /usr/local/bin/cmake -D CMAKE_BUILD_TYPE=$BUILD_TYPE . && make \
66     && echo "3" > /opt/e2/rmr.verbose
67
68
69
70 RUN if [$BUILD_TYPE == "Debug"] ; then make e2_coverage ; fi
71
72 #    && git clone http://gerrit.o-ran-sc.org/r/ric-plt/tracelibcpp \
73 #    && cd tracelibcpp && mkdir build && cd build  \
74 #    &&  sed -i '19iset\(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3"\)' ../CMakeLists.txt \
75 #    &&  sed -i '19iset\(CMAKE_CXX_STANDARD 17\)' ../CMakeLists.txt\
76 #    && /usr/local/bin/cmake .. && make && cd .. && cp include/tracelibcpp/tracelibcpp.hpp . && cd .. \
77 #    && mkdir nlohmann && cd nlohmann && find / -type f -name "json.hpp" -exec cp {} json.hpp \; && cd .. \
78 #    && find / -type d -name "opentracing" -exec cp -r {} . \; \
79 #    && cd /usr/local/lib/ && find / -type f -name "libyaml-cpp.a" -exec cp {} libyaml-cpp.a \; \
80 #    && find / -type f -name "libopentracing.a" -exec cp {} libopentracing.a \; && cd /opt/e2/RIC-E2-TERMINATION && ls nlohmann  \
81
82 FROM ubuntu:18.04
83 RUN apt-get update && apt-get install -y net-tools iputils-ping curl tcpdump && mkdir -p /opt/e2/config
84
85 COPY --from=ubuntu /opt/e2/e2 /opt/e2/e2
86 COPY --from=ubuntu /opt/e2/rmr.verbose /tmp/rmr.verbose
87 COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/dockerRouter.txt /opt/e2/dockerRouter.txt
88 COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/config/config.conf /opt/e2/config/config.conf
89 COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/startup.sh /opt/e2/startup.sh
90 #COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/tracelibcpp/build/libtracelibcpp.so /usr/local/lib/libtracelibcpp.so
91 #COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/tracelibcpp/build/libtracelibcpp.so.0 /usr/local/lib/libtracelibcpp.so.0
92 #COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/tracelibcpp/build/libtracelibcpp.so.0.0.2 /usr/local/lib/libtracelibcpp.so.0.0.2
93
94
95 COPY --from=ubuntu /usr/local/lib/librmr_si.so.4.7.4 /usr/local/lib/librmr_si.so.4.7.4
96 COPY --from=ubuntu /usr/local/lib/librmr_si.so.4  /usr/local/lib/librmr_si.so.4
97 COPY --from=ubuntu /usr/local/lib/librmr_si.so /usr/local/lib/librmr_si.so
98
99 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libmdclog.so /usr/local/lib/libmdclog.so
100 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libmdclog.so.0 /usr/local/lib/libmdclog.so.0
101 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libmdclog.so.0.1.7 /usr/local/lib/libmdclog.so.0.1.7
102
103 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libcgreen.so /usr/local/libcgreen.so
104 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libcgreen.so.1 /usr/local/libcgreen.so.1
105 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libcgreen.so.1.2.0 /usr/local/libcgreen.so.1.2.0
106
107 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libtbb.so /usr/local/libtbb.so
108 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libtbb.so.2 /usr/local/libtbb.so.2
109
110 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libtbbmalloc.so /usr/local/libtbbmalloc.so
111 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libtbbmalloc.so.2 /usr/local/libtbbmalloc.so.2
112
113 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so /usr/local/libtbbmalloc_proxy.so
114 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so.2 /usr/local/libtbbmalloc_proxy.so.2
115
116 COPY --from=ubuntu /usr/lib/libboost_log_setup.so /usr/lib/libboost_log_setup.so
117 COPY --from=ubuntu /usr/lib/libboost_log_setup.so.1.69.0 /usr/lib/libboost_log_setup.so.1.69.0
118
119 #COPY --from=ubuntu /usr/local/lib/libpistache.so  /usr/local/lib/libpistache.so
120 #COPY --from=ubuntu /usr/local/lib/libpistache.so.0  /usr/local/lib/libpistache.so.0
121 #COPY --from=ubuntu /usr/local/lib/libpistache.so.0.0.001-git20191031  /usr/local/lib/libpistache.so.0.0.001-git20191031
122
123
124 COPY --from=ubuntu /usr/lib/libboost_log.so /usr/lib/libboost_log.so
125 COPY --from=ubuntu /usr/lib/libboost_log.so.1.69.0 /usr/lib/libboost_log.so.1.69.0
126
127 COPY --from=ubuntu /usr/lib/libboost_thread.so /usr/lib/libboost_thread.so
128 COPY --from=ubuntu /usr/lib/libboost_thread.so.1.69.0 /usr/lib/libboost_thread.so.1.69.0
129
130 COPY --from=ubuntu /usr/lib/libboost_filesystem.so /usr/lib/libboost_filesystem.so
131 COPY --from=ubuntu /usr/lib/libboost_filesystem.so.1.69.0 /usr/lib/libboost_filesystem.so.1.69.0
132
133 COPY --from=ubuntu /usr/lib/libboost_regex.so /usr/lib/libboost_regex.so
134 COPY --from=ubuntu /usr/lib/libboost_regex.so.1.69.0 /usr/lib/libboost_regex.so.1.69.0
135
136 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicui18n.so /usr/lib/libicui18n.so
137 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicui18n.so.60.2 /usr/lib/libicui18n.so.60.2
138 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicui18n.so.60 /usr/lib/libicui18n.so.60
139
140 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicuuc.so /usr/lib/libicuuc.so
141 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicuuc.so.60.2 /usr/lib/libicuuc.so.60.2
142 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicuuc.so.60 /usr/lib/libicuuc.so.60
143
144 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicudata.so /usr/lib/libicudata.so
145 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicudata.so.60.2 /usr/lib/libicudata.so.60.2
146 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libicudata.so.60 /usr/lib/libicudata.so.60
147
148 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/libstdc++.so.6
149
150 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0 /usr/lib/libcurl-gnutls.so.4.5.0
151 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 /usr/lib/libcurl-gnutls.so.4
152 COPY --from=ubuntu /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so /usr/lib/libcurl-gnutls.so
153
154 COPY --from=ubuntu /usr/local/bin/rmr_probe /opt/e2/rmr_probe
155
156 WORKDIR /opt/e2/
157 ENV LD_LIBRARY_PATH=/usr/local/lib
158 ENV RMR_SEED_RT=dockerRouter.txt
159 ENV E2TERM_POD_NAME=e2term
160 RUN chmod +x /opt/e2/startup.sh /opt/e2/rmr_probe
161 EXPOSE 38000
162 CMD ["sh", "-c", "./startup.sh"]