1 # ==================================================================================
2 # Copyright (c) 2018-2019 AT&T Intellectual Property.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ==================================================================================
17 FROM alpine AS xapp-alpine-go-base
19 RUN apk update && apk add build-base autoconf automake libtool cmake ninja pkgconfig git go
22 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/lib/rmr
23 RUN mkdir /tmp/rmr/build
24 WORKDIR /tmp/rmr/build
25 RUN cmake .. -DPACK_EXTERNALS=1 -DDEV_PKG=1
28 RUN mkdir /tmp/robot-xapp
29 COPY xapp/src /tmp/robot-xapp
30 WORKDIR /tmp/robot-xapp
31 ENV CGO_CFLAGS "-I /usr/local/include -L/usr/local/lib"
32 RUN go build robot-xapp.go
37 COPY --from=xapp-alpine-go-base /usr/local/lib64/libnng.so /usr/lib/libnng.so.1
38 COPY --from=xapp-alpine-go-base /tmp/robot-xapp/robot-xapp /robot-xapp
40 COPY xapp/local.rt /local.rt
41 COPY xapp/config-file.json /config-file.json
42 COPY xapp/schema.json /schema.json
44 ENV DBAAS_SERVICE_HOST service-ricplt-dbaas-tcp.ricplt.svc.cluster.local
45 ENV DBAAS_SERVICE_PORT 6379
46 ENV DBAAS_PORT_6379_TCP_ADDR service-ricplt-dbaas-tcp.ricplt.svc.cluster.local
47 ENV DBAAS_PORT_6379_TCP_PORT 6379
49 ENV RMR_SEED_RT /local.rt
52 CMD [ "/robot-xapp", "-f", "/config-file.json" ]