2 #==================================================================================
3 # Copyright (c) 2018-2019 AT&T Intellectual Property.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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 #==================================================================================
18 ARG SCHEMA_PATH=schemas
19 ARG STAGE_DIR=/tmp/helloworld-xapp
21 #==================================================================================
22 FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu16-c-go@sha256:f4ebcc792b501f283c7848018b6f106bbcecf1f9e699035950614460b3c330f8 as ricbuild
24 # to override repo base, pass in repo argument when running docker build:
25 # docker build --build-arg REPOBASE=http://abc.def.org . ....
26 ARG REPOBASE=https://gerrit.oran-osc.org/r
31 # Install necessary packages
34 && apt-get install -y \
35 libcurl4-openssl-dev \
51 # Install mdclog using debian package hosted at packagecloud.io
53 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/mdclog_${MDC_VER}_amd64.deb/download.deb
54 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/mdclog-dev_${MDC_VER}_amd64.deb/download.deb
55 RUN dpkg -i mdclog_${MDC_VER}_amd64.deb
56 RUN dpkg -i mdclog-dev_${MDC_VER}_amd64.deb
58 # Install RMr using debian package hosted at packagecloud.io
60 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
61 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
62 RUN dpkg -i rmr_${RMR_VER}_amd64.deb
63 RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb
65 ## Install SDL Libraries
67 RUN apt-get install -y cpputest
68 RUN apt-get remove -y libboost-all-dev
69 RUN apt-get install -y libboost-all-dev
70 RUN apt-get install -y libhiredis-dev
71 RUN apt-get install -y valgrind
73 RUN git config --global http.proxy http://one.proxy.att.com:8080
74 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/dbaas
75 RUN cd dbaas/redismodule && \
83 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/sdl
91 RUN git config --global --unset http.proxy
95 #git checkout tags/v1.1.0 && \
97 RUN git clone https://github.com/Tencent/rapidjson && \
101 cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
106 ### Copy RNIB library and include rnib.
107 RUN mkdir /usr/local/include/rnib
109 ##-----------------------------------
110 # Now install the program
111 #------------------------------------
114 COPY ${STAGE}/rnib/*.h /usr/local/include/rnib/
115 COPY ${STAGE}/rnibreader_old.a /usr/local/lib/
117 RUN export CPATH=$CPATH:/usr/local/include && \
122 COPY ${SCHEMA_PATH}/* /etc/xapp/
123 COPY init/init_script.py /etc/xapp/init_script.py
125 #---------------------------------------------
126 # #Build the final version
133 ## copy just the needed libraries install it into the final image
134 COPY --from=ricbuild ${STAGE_DIR}/*.deb /tmp/
135 #COPY --from=ricbuild /usr/local/libexec/. /usr/local/libexec/.
136 COPY --from=ricbuild /usr/local/lib/librmr_si* /usr/local/lib/
137 COPY --from=ricbuild /usr/local/lib/libsdl* /usr/local/lib/
138 COPY --from=ricbuild /usr/local/libexec/redismodule/libredis* /usr/local/libexec/redismodule/
139 RUN dpkg -i /tmp/*.deb
140 RUN apt-get update && \
141 apt-get install -y libcurl3 python3 && \
142 apt-get install -y libboost-all-dev cpputest libhiredis-dev valgrind && \
144 COPY --from=ricbuild /etc/xapp/* /etc/xapp/
145 COPY --from=ricbuild /usr/local/bin/hw_xapp_main /usr/local/bin/hw_xapp_main
146 COPY --from=ricbuild ${STAGE_DIR}/rnib/*.h /usr/local/include/rnib/
147 COPY --from=ricbuild ${STAGE_DIR}/rnibreader_old.a /usr/local/lib/
149 ##COPY --from=ricbuild /usr/local/bin/e2e-test-client /usr/local/bin/e2e-test-client
150 ##COPY --from=ricbuild /usr/local/bin/mock-e2term-server /usr/local/bin/mock-e2term-server
151 ##COPY --from=ricbuild /usr/local/bin/e2e-perf-client /usr/local/bin/e2e-perf-client
152 ##COPY --from=ricbuild /usr/local/bin/e2e-perf-server /usr/local/bin/e2e-perf-server
153 ##COPY --from=ricbuild /usr/local/bin/mock-a1-server /usr/local/bin/mock-a1-server
157 RUN sysctl -w net.ipv6.conf.lo.disable_ipv6=1
159 ##ENV PYTHONHOME=/opt/python3 \
160 ## PYTHONPATH=/opt/python3 \
161 ENV RMR_RTG_SVC="9999" \
162 LD_LIBRARY_PATH="/usr/local/lib:/usr/local/libexec" \
169 CONFIG_FILE=/opt/ric/config/config-file.json
173 CMD python3 /etc/xapp/init_script.py $CONFIG_FILE