blob: 0fd0890ff8f4e80a089c69c9e51960c17eb27132 [file] [log] [blame]
rajalakshmisv21b61dd2021-12-07 04:53:03 +00001FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as rcbuild
2
3ENV PATH=/opt/go/1.14/bin:$PATH
4ENV PATH $PATH:/usr/local/bin
5RUN echo $PATH
6RUN go version
7ENV GOPATH /go
8ENV GOBIN /go/bin
9ENV CFG_FILE /opt/ric/config/config-file.json
10
rajalakshmisv960885a2022-05-31 14:59:10 +000011ARG RMRVERSION=4.8.3
rajalakshmisv21b61dd2021-12-07 04:53:03 +000012ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb
13ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb
14RUN wget --content-disposition ${RMRLIBURL} && dpkg -i rmr_${RMRVERSION}_amd64.deb
15RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
16RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
17
rajalakshmisv8737af02022-01-24 09:42:03 +000018ARG XAPPFRAMEVERSION=v0.8.3
rajalakshmisv21b61dd2021-12-07 04:53:03 +000019WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt
20RUN 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
praneeth20211c42f732021-12-07 08:15:45 +000026WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-app/rc
rajalakshmisv21b61dd2021-12-07 04:53:03 +000027COPY go.mod .
28COPY go.sum .
29COPY cmd cmd
30COPY control control
31COPY e2ap e2ap
32COPY e2sm e2sm
33COPY protocol protocol
34COPY xapp-descriptor xapp-descriptor
35RUN ls
36
37RUN go get golang.org/x/net@v0.0.0-20210614182718-04defd469f4e
38RUN go get google.golang.org/grpc@v1.39.0
39
40# "COMPILING E2AP Wrapper"
41RUN 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"
50RUN 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
59RUN go build ./cmd/rc.go && pwd && ls -lat
60
61FROM ubuntu:18.04
62ENV CFG_FILE /opt/ric/config/config-file.json
63COPY --from=rcbuild /usr/local/lib /usr/local/lib
64RUN ldconfig
praneeth20211c42f732021-12-07 08:15:45 +000065WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-app/rc
66COPY --from=rcbuild /go/src/gerrit.o-ran-sc.org/r/ric-app/rc/rc .
rajalakshmisv21b61dd2021-12-07 04:53:03 +000067CMD ./rc