3 MAINTAINER alexandru.stancu@highstreet-technologies.com
5 LABEL maintainer="alexandru.stancu@highstreet-technologies.com"
9 #LABEL build-date=$BUILD_DATE
12 apt-get update && apt-get install -y \
34 libcurl4-openssl-dev \
42 adduser --system netconf && \
43 echo "netconf:netconf" | chpasswd
45 # generate ssh keys for netconf user
47 mkdir -p /home/netconf/.ssh && \
49 ssh-keygen -t dsa -P '' -f /home/netconf/.ssh/id_dsa && \
50 cat /home/netconf/.ssh/id_dsa.pub > /home/netconf/.ssh/authorized_keys && \
51 #echo "Host *\n StrictHostKeyChecking accept-new" >> /home/netconf/.ssh/config
52 echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
53 mkdir -p /root/.ssh && \
54 cat /home/netconf/.ssh/id_dsa.pub > /root/.ssh/authorized_keys
56 # use /opt/dev as working directory
61 COPY ./cJSON /opt/dev/cJSON
63 cd cJSON && mkdir build && cd build && \
64 cmake .. -DENABLE_CJSON_UTILS=On -DENABLE_CJSON_TEST=Off -DCMAKE_INSTALL_PREFIX=/usr .. && \
70 COPY ./libyang /opt/dev/libyang
72 cd libyang && mkdir build && cd build && \
73 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
79 COPY ./sysrepo /opt/dev/sysrepo
81 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 && \
82 cd sysrepo && mkdir build && cd build && \
83 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_TESTS=OFF -DREPOSITORY_LOC:PATH=/etc/sysrepo -DREQUEST_TIMEOUT=60 -DOPER_DATA_PROVIDE_TIMEOUT=60 .. && \
89 COPY ./libnetconf2 /opt/dev/libnetconf2
91 cd libnetconf2 && mkdir build && cd build && \
92 cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
98 COPY ./Netopeer2 /opt/dev/Netopeer2
102 cd keystored && mkdir build && cd build && \
103 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
108 # overwrite number of endpoints exposed by the NETCONF server
109 COPY ./ntsimulator/scripts/stock_config.xml /opt/dev/Netopeer2/server/stock_config.xml
113 cd Netopeer2/server && mkdir build && cd build && \
114 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
117 cd ../../cli && mkdir build && cd build && \
118 cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
122 RUN pip install rstr && pip install exrex && pip install ipaddress
124 COPY ./pyang /opt/dev/pyang
127 cd pyang && python setup.py build && python setup.py install
129 #NTSimulator Manager - notifications
130 COPY ./ntsimulator /opt/dev/ntsimulator
133 cd ntsimulator && mkdir build && cd build && \
138 COPY ntsimulator/deploy/supervisord.conf /etc/supervisord.conf
140 COPY ./ntsimulator/scripts/tls /home/netconf/.ssh
142 COPY ./ntsimulator/yang /opt/dev/yang
160 CMD ["sh", "-c", "/usr/bin/supervisord -c /etc/supervisord.conf"]