rajalakshmisv | 21b61dd | 2021-12-07 04:53:03 +0000 | [diff] [blame] | 1 | FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as rcbuild |
| 2 | |
| 3 | ENV PATH=/opt/go/1.14/bin:$PATH |
| 4 | ENV PATH $PATH:/usr/local/bin |
| 5 | RUN echo $PATH |
| 6 | RUN go version |
| 7 | ENV GOPATH /go |
| 8 | ENV GOBIN /go/bin |
| 9 | ENV CFG_FILE /opt/ric/config/config-file.json |
| 10 | |
| 11 | ARG RMRVERSION=4.0.2 |
| 12 | ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb |
| 13 | ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb |
| 14 | RUN wget --content-disposition ${RMRLIBURL} && dpkg -i rmr_${RMRVERSION}_amd64.deb |
| 15 | RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb |
| 16 | RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb |
| 17 | |
| 18 | ARG XAPPFRAMEVERSION=v0.4.11 |
| 19 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt |
| 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 | |
praneeth2021 | 1c42f73 | 2021-12-07 08:15:45 +0000 | [diff] [blame] | 26 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-app/rc |
rajalakshmisv | 21b61dd | 2021-12-07 04:53:03 +0000 | [diff] [blame] | 27 | COPY go.mod . |
| 28 | COPY go.sum . |
| 29 | COPY cmd cmd |
| 30 | COPY control control |
| 31 | COPY e2ap e2ap |
| 32 | COPY e2sm e2sm |
| 33 | COPY protocol protocol |
| 34 | COPY xapp-descriptor xapp-descriptor |
| 35 | RUN ls |
| 36 | |
| 37 | RUN go get golang.org/x/net@v0.0.0-20210614182718-04defd469f4e |
| 38 | RUN go get google.golang.org/grpc@v1.39.0 |
| 39 | |
| 40 | # "COMPILING E2AP Wrapper" |
| 41 | RUN cd e2ap && \ |
| 42 | gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \ |
| 43 | gcc *.o -shared -o libe2apwrapper.so && \ |
| 44 | cp libe2apwrapper.so /usr/local/lib/ && \ |
| 45 | mkdir /usr/local/include/e2ap && \ |
| 46 | cp wrapper.h headers/*.h /usr/local/include/e2ap && \ |
| 47 | ldconfig |
| 48 | |
| 49 | # "COMPILING E2SM Wrapper" |
| 50 | RUN cd e2sm && \ |
| 51 | gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \ |
| 52 | gcc *.o -shared -o libe2smwrapper.so && \ |
| 53 | cp libe2smwrapper.so /usr/local/lib/ && \ |
| 54 | mkdir /usr/local/include/e2sm && \ |
| 55 | cp wrapper.h headers/*.h /usr/local/include/e2sm && \ |
| 56 | ldconfig |
| 57 | |
| 58 | |
| 59 | RUN go build ./cmd/rc.go && pwd && ls -lat |
| 60 | |
| 61 | FROM ubuntu:18.04 |
| 62 | ENV CFG_FILE /opt/ric/config/config-file.json |
| 63 | COPY --from=rcbuild /usr/local/lib /usr/local/lib |
| 64 | RUN ldconfig |
praneeth2021 | 1c42f73 | 2021-12-07 08:15:45 +0000 | [diff] [blame] | 65 | WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-app/rc |
| 66 | COPY --from=rcbuild /go/src/gerrit.o-ran-sc.org/r/ric-app/rc/rc . |
rajalakshmisv | 21b61dd | 2021-12-07 04:53:03 +0000 | [diff] [blame] | 67 | CMD ./rc |