jinwei.fan | 94eedf9 | 2021-01-29 14:43:41 +0800 | [diff] [blame] | 1 | FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as kpimonbuild |
jinweifan | 4a8b4de | 2020-07-27 14:02:49 +0800 | [diff] [blame] | 2 | |
| 3 | ENV PATH $PATH:/usr/local/bin |
| 4 | ENV GOPATH /go |
| 5 | ENV GOBIN /go/bin |
| 6 | ENV RMR_SEED_RT /opt/routes.txt |
| 7 | |
| 8 | COPY routes.txt /opt/routes.txt |
| 9 | |
| 10 | ARG RMRVERSION=4.0.2 |
| 11 | ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb |
| 12 | ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb |
| 13 | RUN wget --content-disposition ${RMRLIBURL} && dpkg -i rmr_${RMRVERSION}_amd64.deb |
| 14 | RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb |
| 15 | RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb |
| 16 | |
| 17 | ARG XAPPFRAMEVERSION=v0.4.11 |
| 18 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt |
jinwei.fan | fd02019 | 2021-01-29 14:20:23 +0800 | [diff] [blame] | 19 | RUN git clone "https://gerrit.o-ran-sc.org/r/ric-plt/sdlgo" |
jinweifan | 4a8b4de | 2020-07-27 14:02:49 +0800 | [diff] [blame] | 20 | RUN git clone -b ${XAPPFRAMEVERSION} "https://gerrit.o-ran-sc.org/r/ric-plt/xapp-frame" |
| 21 | RUN cd xapp-frame && \ |
| 22 | GO111MODULE=on go mod vendor -v && \ |
| 23 | cp -r vendor/* /go/src/ && \ |
| 24 | rm -rf vendor |
| 25 | |
| 26 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon |
| 27 | COPY control/ control/ |
| 28 | COPY cmd/ cmd/ |
| 29 | COPY e2ap/ e2ap/ |
| 30 | COPY e2sm/ e2sm/ |
| 31 | |
| 32 | # "COMPILING E2AP Wrapper" |
| 33 | RUN cd e2ap && \ |
| 34 | gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \ |
| 35 | gcc *.o -shared -o libe2apwrapper.so && \ |
| 36 | cp libe2apwrapper.so /usr/local/lib/ && \ |
| 37 | mkdir /usr/local/include/e2ap && \ |
| 38 | cp wrapper.h headers/*.h /usr/local/include/e2ap && \ |
| 39 | ldconfig |
| 40 | |
| 41 | # "COMPILING E2SM Wrapper" |
| 42 | RUN cd e2sm && \ |
| 43 | gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \ |
| 44 | gcc *.o -shared -o libe2smwrapper.so && \ |
| 45 | cp libe2smwrapper.so /usr/local/lib/ && \ |
| 46 | mkdir /usr/local/include/e2sm && \ |
| 47 | cp wrapper.h headers/*.h /usr/local/include/e2sm && \ |
| 48 | ldconfig |
| 49 | |
| 50 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon |
| 51 | |
| 52 | RUN mkdir pkg |
| 53 | |
| 54 | RUN go build ./cmd/kpimon.go && pwd && ls -lat |
| 55 | |
| 56 | |
| 57 | FROM ubuntu:18.04 |
| 58 | COPY --from=kpimonbuild /usr/local/lib /usr/local/lib |
| 59 | COPY --from=kpimonbuild /usr/local/include/e2ap/*.h /usr/local/include/e2ap/ |
| 60 | COPY --from=kpimonbuild /usr/local/include/e2sm/*.h /usr/local/include/e2sm/ |
| 61 | RUN ldconfig |
| 62 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/ |
| 63 | COPY --from=kpimonbuild /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/config-file.yaml . |
| 64 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon |
| 65 | COPY --from=kpimonbuild /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon/kpimon . |
| 66 | |