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
21 LABEL maintainer="alexandru.stancu@highstreet-technologies.com"
25 #LABEL build-date=$BUILD_DATE
28 apt-get update && apt-get install -y \
50 libcurl4-openssl-dev \
58 adduser --system netconf && \
59 echo "netconf:netconf" | chpasswd
61 # generate ssh keys for netconf user
63 mkdir -p /home/netconf/.ssh && \
65 ssh-keygen -t dsa -P '' -f /home/netconf/.ssh/id_dsa && \
66 cat /home/netconf/.ssh/id_dsa.pub > /home/netconf/.ssh/authorized_keys && \
67 #echo "Host *\n StrictHostKeyChecking accept-new" >> /home/netconf/.ssh/config
68 echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
69 mkdir -p /root/.ssh && \
70 cat /home/netconf/.ssh/id_dsa.pub > /root/.ssh/authorized_keys
72 # use /opt/dev as working directory
78 git clone https://github.com/Melacon/cJSON.git && \
79 cd cJSON && mkdir build && cd build && \
80 cmake .. -DENABLE_CJSON_UTILS=On -DENABLE_CJSON_TEST=Off -DCMAKE_INSTALL_PREFIX=/usr .. && \
87 git clone https://github.com/Melacon/libyang.git && \
88 cd libyang && mkdir build && cd build && \
89 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
96 git clone https://github.com/Melacon/sysrepo.git && \
97 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 && \
98 cd sysrepo && mkdir build && cd build && \
99 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_TESTS=OFF -DREPOSITORY_LOC:PATH=/etc/sysrepo -DREQUEST_TIMEOUT=60 -DOPER_DATA_PROVIDE_TIMEOUT=60 .. && \
106 git clone https://github.com/Melacon/libnetconf2.git && \
107 cd libnetconf2 && mkdir build && cd build && \
108 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
116 git clone https://github.com/Melacon/Netopeer2.git && \
118 cd keystored && mkdir build && cd build && \
119 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
124 # overwrite number of endpoints exposed by the NETCONF server
125 COPY ./scripts/stock_config.xml /opt/dev/Netopeer2/server/stock_config.xml
129 cd Netopeer2/server && mkdir build && cd build && \
130 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
133 cd ../../cli && mkdir build && cd build && \
134 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
138 RUN pip install rstr && pip install exrex && pip install ipaddress
143 git clone https://github.com/Melacon/pyang.git && \
144 cd pyang && python setup.py build && python setup.py install
146 #NTSimulator Manager - notifications
147 COPY . /opt/dev/ntsimulator
150 cd ntsimulator && mkdir build && cd build && \
155 COPY deploy/supervisord.conf /etc/supervisord.conf
157 COPY ./scripts/tls /home/netconf/.ssh
159 COPY ./yang /opt/dev/yang
177 CMD ["sh", "-c", "/usr/bin/supervisord -c /etc/supervisord.conf"]