blob: 4652071f38300702c32fde77113ab1975fb55b52 [file] [log] [blame]
jinwei.fan94eedf92021-01-29 14:43:41 +08001FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as kpimonbuild
jinweifan4a8b4de2020-07-27 14:02:49 +08002
3ENV PATH $PATH:/usr/local/bin
4ENV GOPATH /go
5ENV GOBIN /go/bin
6ENV RMR_SEED_RT /opt/routes.txt
7
8COPY routes.txt /opt/routes.txt
9
10ARG RMRVERSION=4.0.2
11ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb
12ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb
13RUN wget --content-disposition ${RMRLIBURL} && dpkg -i rmr_${RMRVERSION}_amd64.deb
14RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
15RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
16
17ARG XAPPFRAMEVERSION=v0.4.11
18WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt
jinwei.fanfd020192021-01-29 14:20:23 +080019RUN git clone "https://gerrit.o-ran-sc.org/r/ric-plt/sdlgo"
jinweifan4a8b4de2020-07-27 14:02:49 +080020RUN git clone -b ${XAPPFRAMEVERSION} "https://gerrit.o-ran-sc.org/r/ric-plt/xapp-frame"
21RUN cd xapp-frame && \
22 GO111MODULE=on go mod vendor -v && \
23 cp -r vendor/* /go/src/ && \
24 rm -rf vendor
25
26WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon
27COPY control/ control/
28COPY cmd/ cmd/
29COPY e2ap/ e2ap/
30COPY e2sm/ e2sm/
31
32# "COMPILING E2AP Wrapper"
33RUN 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"
42RUN 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
50WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon
51
52RUN mkdir pkg
53
54RUN go build ./cmd/kpimon.go && pwd && ls -lat
55
56
57FROM ubuntu:18.04
58COPY --from=kpimonbuild /usr/local/lib /usr/local/lib
59COPY --from=kpimonbuild /usr/local/include/e2ap/*.h /usr/local/include/e2ap/
60COPY --from=kpimonbuild /usr/local/include/e2sm/*.h /usr/local/include/e2sm/
61RUN ldconfig
62WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/
63COPY --from=kpimonbuild /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/config-file.yaml .
64WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon
65COPY --from=kpimonbuild /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon/kpimon .
66