blob: 444c1588677ddc30d8875d8366890fc8e404645f [file] [log] [blame]
sandeepindiafbc7e3a2023-06-28 18:03:26 +05301FROM kumarsandeep3/hcl-bouncer-base-image-ubntu-20:1.0.0 as buildenv
2RUN mkdir -p /lite
3WORKDIR /lite
4#RUN apt-get update
5COPY e2ap/ e2ap/
6COPY e2sm_kpm/ e2sm_kpm/
7COPY e2sm_rc/ e2sm_rc/
8# "COMPILING E2AP Wrapper"
9RUN cd e2ap && \
10 gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
11 gcc *.o -shared -o libe2apwrapper.so && \
12 cp libe2apwrapper.so /usr/local/lib/ && \
13 mkdir /usr/local/include/e2ap && \
14 cp wrapper.h headers/*.h /usr/local/include/e2ap && \
15 ldconfig
16# "COMPILING E2SM-KPM Wrapper"
17RUN cd e2sm_kpm && \
18 gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
19 gcc *.o -shared -o libe2smkpmwrapper.so&& \
20 cp libe2smkpmwrapper.so /usr/local/lib/ && \
21 mkdir /usr/local/include/e2sm_kpm && \
22 cp wrapper.h headers/*.h /usr/local/include/e2sm_kpm && \
23 ldconfig
24# "COMPILING E2SM-RC Wrapper"
25RUN cd e2sm_rc && \
26 gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
27 gcc *.o -shared -o libe2smrcwrapper.so&& \
28 cp libe2smrcwrapper.so /usr/local/lib/ && \
29 mkdir /usr/local/include/e2sm_rc && \
30 cp wrapper.h headers/*.h /usr/local/include/e2sm_rc && \
31 ldconfig
himeshshuklaff201292021-05-11 13:40:12 +053032
33
sandeepindiafbc7e3a2023-06-28 18:03:26 +053034# ----- copy files and source code ----------------------------------
himeshshuklaff201292021-05-11 13:40:12 +053035
sandeepindiafbc7e3a2023-06-28 18:03:26 +053036COPY routes.txt .
37COPY xapp-descriptor/ xapp-descriptor/
38COPY src/ src/
himeshshuklaff201292021-05-11 13:40:12 +053039
40
sandeepindiafbc7e3a2023-06-28 18:03:26 +053041RUN g++ -std=c++17 /lite/src/*.cpp -I /lite/src/ -I /lite/e2ap/headers -I /lite/e2sm_kpm/headers -I /lite/e2sm_rc/headers -o bouncer-xapp -lricxfcpp -lrmr_si -lpthread -lm -lboost_system -lcrypto -lssl -lcpprest -lpistache -lnlohmann_json_schema_validator -le2apwrapper -le2smrcwrapper -le2smrcwrapper
himeshshuklaff201292021-05-11 13:40:12 +053042
sandeepindiafbc7e3a2023-06-28 18:03:26 +053043RUN cp bouncer-xapp /usr/local/bin/
himeshshuklaff201292021-05-11 13:40:12 +053044
sandeepindiafbc7e3a2023-06-28 18:03:26 +053045# ----- create final, smaller, image ----------------------------------
46FROM ubuntu:20.04
himeshshuklaff201292021-05-11 13:40:12 +053047
sandeepindiafbc7e3a2023-06-28 18:03:26 +053048RUN mkdir -p /lite
49WORKDIR /lite
himeshshuklaff201292021-05-11 13:40:12 +053050
sandeepindiafbc7e3a2023-06-28 18:03:26 +053051COPY --from=buildenv /usr/local/lib /usr/local/lib/
52#for ssl
53COPY --from=buildenv /lib/x86_64-linux-gnu/libcrypto.so.1.1 /lib/x86_64-linux-gnu/libcrypto.so.1.1
54COPY --from=buildenv /lib/x86_64-linux-gnu/libssl.so.1.1 /lib/x86_64-linux-gnu/libssl.so.1.1
55
56COPY --from=buildenv /usr/local/include /usr/local/include
57COPY --from=buildenv /usr/local/bin/ /usr/local/bin/
58COPY --from=buildenv /lite/routes.txt /lite/routes.txt
59
60ENV RMR_SEED_RT=/lite/routes.txt
61ENV RMR_SRC_ID=service-ricxapp-bouncer-xapp-rmr.ricxapp:4560
62ENV PATH=/usr/local/bin:$PATH
63ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib
himeshshuklaff201292021-05-11 13:40:12 +053064
65
sandeepindiafbc7e3a2023-06-28 18:03:26 +053066CMD [ "/usr/local/bin/bouncer-xapp" ]