Update RMR version in listener image
[ric-app/mc.git] / mc-core / Dockerfile
1 # -------------------------------------------------------------------------------
2 #    Copyright (c) 2018-2019 AT&T Intellectual Property.
3 #
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
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
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 # -------------------------------------------------------------------------------
16
17 ARG STAGE_DIR=/mc
18
19 # builders are now in release (10002)
20 FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 AS project-build
21
22 ARG STAGE_DIR
23
24 ARG RMR_VER=4.5.2
25
26 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
27 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
28 RUN dpkg -i rmr_${RMR_VER}_amd64.deb
29 RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb
30 RUN ldconfig
31
32 COPY mc ${STAGE_DIR}
33 WORKDIR ${STAGE_DIR}
34 RUN apt-get update && \
35         apt-get install -y libboost-all-dev && \
36         apt-get install -y libhiredis-dev && \
37         apt-get clean
38 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/sdl
39 WORKDIR ${STAGE_DIR}/sdl
40 RUN ./autogen.sh
41 RUN ./configure
42 RUN make all
43 RUN make install
44 WORKDIR ${STAGE_DIR}
45 RUN git clone https://github.com/protocolbuffers/protobuf.git
46 WORKDIR ${STAGE_DIR}/protobuf
47 RUN ./autogen.sh
48 RUN ./configure
49 RUN make clean
50 RUN make
51 RUN make install
52 RUN ldconfig
53
54 # hack to get protobufs to build
55 RUN cp src/google/protobuf/stubs/int128.h /usr/local/include/google/protobuf/stubs
56
57 WORKDIR ${STAGE_DIR}
58 RUN git clone https://github.com/protobuf-c/protobuf-c.git
59 WORKDIR protobuf-c
60 RUN ./autogen.sh
61 ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
62 RUN ./configure
63 RUN make
64 RUN make install
65 RUN ldconfig
66 WORKDIR ${STAGE_DIR}
67 RUN git clone -b release/0.3.0 https://gerrit.o-ran-sc.org/r/com/gs-lite
68 WORKDIR ${STAGE_DIR}/gs-lite
69 COPY mc/cfg/packet_schema.txt ${STAGE_DIR}/gs-lite/cfg/
70 COPY mc/cfg/ifres.xml ${STAGE_DIR}/gs-lite/cfg/
71 COPY mc/cfg/localhost.ifq ${STAGE_DIR}/gs-lite/cfg/
72 COPY mc/local_datasource ${STAGE_DIR}/gs-lite/src/lib/gscprts/local_datasource
73 COPY mc/local ${STAGE_DIR}/gs-lite/include/lfta/local
74 COPY mc/queries ${STAGE_DIR}/gs-lite/demo/queries
75 COPY mc/mcnib/* ${STAGE_DIR}/gs-lite/src/tools/
76 RUN ./build_and_install.sh
77 WORKDIR ${STAGE_DIR}/gs-lite/demo/queries
78 ENV GSLITE_ROOT ${STAGE_DIR}/gs-lite
79 RUN bash ${STAGE_DIR}/gs-lite/bin/buildit
80 RUN python generate_runall.py
81
82
83 # now install the binaries and libraries into smaller docker image
84 FROM nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-mc-listener:1.7.0
85
86 # keep this close to the top to prevent lengthy rebuilds during testing
87 RUN apt-get update && \
88     apt-get install -y curl python python-pip libboost-all-dev libhiredis-dev && \
89     apt-get clean
90
91 ARG STAGE_DIR
92
93 COPY --from=project-build ${STAGE_DIR}/gs-lite/demo/queries /mc/gs-lite/demo/queries
94 COPY --from=project-build ${STAGE_DIR}/gs-lite/bin /mc/gs-lite/bin
95 COPY --from=project-build ${STAGE_DIR}/data_gen /mc/data_gen
96 COPY --from=project-build ${STAGE_DIR}/extract_params.py /mc/
97 COPY --from=project-build ${STAGE_DIR}/extract_rmr_port.py /mc/
98 COPY --from=project-build /usr/local/lib/libproto* /usr/local/lib/
99 COPY --from=project-build /usr/local/lib/libsdl* /usr/local/lib/
100
101 WORKDIR /opt/ric/config
102 COPY --from=project-build ${STAGE_DIR}/mc_deployment.json /opt/ric/config/config-file.json
103
104 COPY container_start.sh /playpen/bin/
105 COPY package/*.py package/*.sh /playpen/bin/
106
107 RUN ldconfig
108 RUN pip install protobuf
109
110 ENV XAPP_DESCRIPTOR_PATH /opt/ric/config/
111 WORKDIR /playpen
112 ENV GSLITE_ROOT /mc/gs-lite
113
114 CMD ["/playpen/bin/container_start.sh"]