SIM-117: E2-interface fails trying to connect ricplt/e2 termintor
[sim/e2-interface.git] / e2sim / Dockerfile_kpm
1 # vim: ts=4 sw=4 noet:
2 #==================================================================================
3 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
4 #
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #          http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 #==================================================================================
17
18
19 # --------------------------------------------------------------------------------------
20 #       Mnemonic:       Dockerfile
21 #       Abstract:       This dockerfile is used to create an image that can be used to
22 #                               run the traffic steering xAPP in a container.
23 #
24 #                               Building should be as simple as:
25 #
26 #                                       docker build -f Dockerfile -t ric-app-ts:[version]
27 #
28 #       Date:           27 April 2020
29 #       Author:         E. Scott Daniels
30 # --------------------------------------------------------------------------------------
31
32 # the builder has: git, wget, cmake, gcc/g++, make, python2/3. v7 dropped nng support
33 #
34 ARG CONTAINER_PULL_REGISTRY=nexus3.o-ran-sc.org:10001
35 FROM ${CONTAINER_PULL_REGISTRY}/o-ran-sc/bldr-ubuntu22-c-go:1.0.0 as buildenv
36
37 # spaces to save things in the build image to copy to final image
38 RUN mkdir -p /playpen/assets /playpen/src /playpen/bin /playpen/asn1c /playpen/e2sim
39 ARG SRC=.
40
41 WORKDIR /playpen
42
43 # versions we snarf from package cloud
44 ARG E2SIM_VER=1.0.0
45
46 RUN apt-get update \
47         && apt-get install -y \
48         build-essential \
49         git \
50         cmake \
51         libsctp-dev \
52         lksctp-tools \
53         autoconf \
54         automake \
55         libtool \
56         bison \
57         flex \
58   libboost-all-dev \
59         iputils-ping \
60         net-tools \
61         nano \
62         vim \
63         tcpdump \
64         net-tools \
65         nmap \
66   && apt-get clean
67
68 COPY asn1c/ /playpen/e2sim/asn1c
69 COPY e2sm_examples/ /playpen/e2sim/e2sm_examples
70 COPY src/ /playpen/e2sim/src
71 COPY CMakeLists.txt /playpen/e2sim
72
73 RUN mkdir /playpen/e2sim/build && cd /playpen/e2sim/build && cmake .. && make package && cmake .. -DDEV_PKG=1 && make package
74
75 RUN dpkg -i /playpen/e2sim/build/e2sim_1.0.0_amd64.deb /playpen/e2sim/build/e2sim-dev_1.0.0_amd64.deb
76
77 RUN rm -rf /playpen/e2sim
78
79 RUN mkdir /usr/local/include/nlohmann
80 RUN git clone https://github.com/azadkuh/nlohmann_json_release.git
81 RUN cp nlohmann_json_release/json.hpp /usr/local/include/nlohmann
82
83 COPY ./e2sm_examples/kpm_e2sm/ /playpen/src/
84 COPY asn1c/ /playpen/src/asn1c/
85 RUN wc -l /playpen/src/reports.json
86  RUN cd /playpen/src && \
87                 rm -fr .build &&\
88                 mkdir  .build && \
89                 cd .build && \
90                 cmake .. && \
91                 make install
92
93 #CMD sleep 100000000000
94 #CMD kpm_sim 10.111.138.172 32222