sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 1 | FROM kumarsandeep3/hcl-bouncer-base-image-ubntu-20:1.0.0 as buildenv |
| 2 | RUN mkdir -p /lite |
| 3 | WORKDIR /lite |
| 4 | #RUN apt-get update |
| 5 | COPY e2ap/ e2ap/ |
| 6 | COPY e2sm_kpm/ e2sm_kpm/ |
| 7 | COPY e2sm_rc/ e2sm_rc/ |
| 8 | # "COMPILING E2AP Wrapper" |
| 9 | RUN 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" |
| 17 | RUN 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" |
| 25 | RUN 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 |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 32 | |
| 33 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 34 | # ----- copy files and source code ---------------------------------- |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 35 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 36 | COPY routes.txt . |
| 37 | COPY xapp-descriptor/ xapp-descriptor/ |
| 38 | COPY src/ src/ |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 39 | |
| 40 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 41 | RUN 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 |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 42 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 43 | RUN cp bouncer-xapp /usr/local/bin/ |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 44 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 45 | # ----- create final, smaller, image ---------------------------------- |
| 46 | FROM ubuntu:20.04 |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 47 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 48 | RUN mkdir -p /lite |
| 49 | WORKDIR /lite |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 50 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 51 | COPY --from=buildenv /usr/local/lib /usr/local/lib/ |
| 52 | #for ssl |
| 53 | COPY --from=buildenv /lib/x86_64-linux-gnu/libcrypto.so.1.1 /lib/x86_64-linux-gnu/libcrypto.so.1.1 |
| 54 | COPY --from=buildenv /lib/x86_64-linux-gnu/libssl.so.1.1 /lib/x86_64-linux-gnu/libssl.so.1.1 |
| 55 | |
| 56 | COPY --from=buildenv /usr/local/include /usr/local/include |
| 57 | COPY --from=buildenv /usr/local/bin/ /usr/local/bin/ |
| 58 | COPY --from=buildenv /lite/routes.txt /lite/routes.txt |
| 59 | |
| 60 | ENV RMR_SEED_RT=/lite/routes.txt |
| 61 | ENV RMR_SRC_ID=service-ricxapp-bouncer-xapp-rmr.ricxapp:4560 |
| 62 | ENV PATH=/usr/local/bin:$PATH |
| 63 | ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib |
himeshshukla | ff20129 | 2021-05-11 13:40:12 +0530 | [diff] [blame] | 64 | |
| 65 | |
sandeepindia | fbc7e3a | 2023-06-28 18:03:26 +0530 | [diff] [blame] | 66 | CMD [ "/usr/local/bin/bouncer-xapp" ] |