1 ################################################################################
3 # Copyright 2019 highstreet technologies GmbH and others
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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 ################################################################################
19 MAINTAINER alexandru.stancu@highstreet-technologies.com
20 LABEL maintainer="alexandru.stancu@highstreet-technologies.com"
23 #LABEL build-date=$BUILD_DATE
25 ENV NETCONF_BASE=40000
26 ENV NTS_IP="127.0.0.1"
27 ENV SCRIPTS_DIR=/opt/dev/scripts
28 ENV DOCKER_ENGINE_VERSION="1.40"
29 ENV MODELS_IMAGE="ntsim_oran"
32 apt-get update && apt-get install -y \
54 libcurl4-openssl-dev \
62 adduser --system netconf && \
63 echo "netconf:netconf" | chpasswd
65 # generate ssh keys for netconf user
67 mkdir -p /home/netconf/.ssh && \
69 ssh-keygen -t dsa -P '' -f /home/netconf/.ssh/id_dsa && \
70 cat /home/netconf/.ssh/id_dsa.pub > /home/netconf/.ssh/authorized_keys && \
71 #echo "Host *\n StrictHostKeyChecking accept-new" >> /home/netconf/.ssh/config
72 echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
73 mkdir -p /root/.ssh && \
74 cat /home/netconf/.ssh/id_dsa.pub > /root/.ssh/authorized_keys
76 # use /opt/dev as working directory
82 git clone https://github.com/Melacon/cJSON.git && \
83 cd cJSON && mkdir build && cd build && \
84 cmake .. -DENABLE_CJSON_UTILS=On -DENABLE_CJSON_TEST=Off -DCMAKE_INSTALL_PREFIX=/usr .. && \
91 git clone https://github.com/Melacon/libyang.git && \
92 cd libyang && mkdir build && cd build && \
93 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
100 git clone https://github.com/Melacon/sysrepo.git && \
101 sed -i 's/#define MAX_BLOCKS_AVAIL_FOR_ALLOC 3/#define MAX_BLOCKS_AVAIL_FOR_ALLOC 6/g' ./sysrepo/src/common/sr_mem_mgmt.h && \
102 cd sysrepo && mkdir build && cd build && \
103 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_TESTS=OFF -DREPOSITORY_LOC:PATH=/etc/sysrepo -DREQUEST_TIMEOUT=60 -DOPER_DATA_PROVIDE_TIMEOUT=60 .. && \
110 git clone https://github.com/Melacon/libnetconf2.git && \
111 cd libnetconf2 && mkdir build && cd build && \
112 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
120 git clone https://github.com/Melacon/Netopeer2.git && \
123 cd keystored && mkdir build && cd build && \
124 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
132 cd Netopeer2/server && mkdir build && cd build && \
133 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
136 cd ../../cli && mkdir build && cd build && \
137 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
142 COPY . /opt/dev/ntsimulator
145 cd ntsimulator && mkdir build && cd build && \
150 COPY deploy/manager/supervisord.conf.manager /etc/supervisord.conf
155 CMD ["sh", "-c", "/usr/bin/supervisord -c /etc/supervisord.conf"]