# limitations under the License.
#----------------------------------------------------------
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:4-u18.04-nng AS o1mediator-build
+FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 AS o1mediator-build
+
+RUN apt update && apt install --reinstall -y \
+ ca-certificates \
+ && \
+ update-ca-certificates
RUN apt-get update -y && apt-get install -y jq \
git \
libev-dev \
libprotobuf-c-dev \
protobuf-c-compiler \
- libssh-dev \
+ #libssh-dev \
libssl-dev \
swig \
iputils-ping \
python-dev
-
-ENV PATH="/usr/local/go/bin:${PATH}"
+#ENV GOLANG_VERSION 1.13.10
+#RUN wget --quiet https://dl.google.com/go/go$GOLANG_VERSION.linux-amd64.tar.gz \
+# && tar xvzf go$GOLANG_VERSION.linux-amd64.tar.gz -C /usr/local
+#ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH="/go"
# ======================================================================
# libyang
RUN \
cd /opt/dev && \
- git clone https://github.com/CESNET/libyang.git && \
+ git clone -b libyang1 https://github.com/CESNET/libyang.git && \
cd libyang && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
make -j2 && \
make install && \
ldconfig
-
# sysrepo
RUN \
cd /opt/dev && \
- git clone https://github.com/sysrepo/sysrepo.git && \
- cd sysrepo && sed -i -e 's/2000/30000/g' src/common.h.in && \
+ git clone -b libyang1 https://github.com/sysrepo/sysrepo.git && \
+ cd sysrepo && sed -i -e 's/2000/30000/g;s/5000/30000/g' src/common.h.in && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_TESTS=OFF -DREPOSITORY_LOC:PATH=/etc/sysrepo .. && \
make -j2 && \
make install && make sr_clean && \
ldconfig
+# libssh Newest
+RUN \
+ cd /opt/dev && \
+ git clone https://git.libssh.org/projects/libssh.git && cd libssh && \
+ mkdir build && cd build && \
+ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE="Release" -DWITH_ZLIB=ON -DWITH_NACL=OFF -DWITH_PCAP=OFF .. && \
+ make -j2 && \
+ make install
+
# libnetconf2
RUN \
cd /opt/dev && \
- git clone https://github.com/CESNET/libnetconf2.git && \
+ git clone -b libyang1 https://github.com/CESNET/libnetconf2.git && \
cd libnetconf2 && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:String="Release" -DENABLE_BUILD_TESTS=OFF .. && \
make -j2 && \
# netopeer2
RUN \
cd /opt/dev && \
- git clone https://github.com/CESNET/Netopeer2.git && \
- cd Netopeer2/server && mkdir build && cd build && \
+ git clone -b libyang1 https://github.com/CESNET/Netopeer2.git && \
+ cd Netopeer2 && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE:String="Release" -DNP2SRV_DATA_CHANGE_TIMEOUT=30000 -DNP2SRV_DATA_CHANGE_WAIT=ON .. && \
make -j2 && \
- make install && \
- cd ../../cli && mkdir build && cd build && \
- cmake -DCMAKE_BUILD_TYPE:String="Release" .. && \
- make -j2 && \
make install
# ======================================================================
# RMR
-ARG RMRVERSION=3.1.0
-ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb
-ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb
+ARG RMRVERSION=4.9.4
+ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb
+ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb
RUN wget --content-disposition ${RMRLIBURL} && dpkg -i rmr_${RMRVERSION}_amd64.deb
RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
+
+# Install kubectl from Docker Hub
+COPY --from=lachlanevenson/k8s-kubectl:v1.16.0 /usr/local/bin/kubectl /usr/local/bin/kubectl
+
RUN ldconfig
# Swagger
RUN /usr/local/bin/sysrepoctl -i /go/src/ws/agent/yang/o-ran-sc-ric-xapp-desc-v1.yang
RUN /usr/local/bin/sysrepoctl -i /go/src/ws/agent/yang/o-ran-sc-ric-ueec-config-v1.yang
RUN /usr/local/bin/sysrepoctl -i /go/src/ws/agent/yang/o-ran-sc-ric-gnb-status-v1.yang
+RUN /usr/local/bin/sysrepoctl -i /go/src/ws/agent/yang/o-ran-sc-ric-alarm-v1.yang
CMD ["/bin/bash"]
#----------------------------------------------------------
-FROM ubuntu:18.04 as o1mediator
+FROM ubuntu:20.04 as o1mediator
-RUN apt-get update -y && apt-get install -y jq \
+RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y jq \
net-tools \
tcpdump \
netcat \
nano \
supervisor \
openssl \
- python-pip \
+ python3-pip \
libpcre3-dev \
pkg-config \
libavl-dev \
libev-dev \
libprotobuf-c-dev \
protobuf-c-compiler \
- libssh-dev \
+ #libssh-dev \
libssl-dev \
swig \
python-dev \
- && pip install supervisor-stdout \
- && pip install psutil \
+ wget \
+ && pip3 install supervisor-stdout \
+ && pip3 install psutil \
&& apt-get clean
+# Install psutil for python2.X
+RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py \
+ && python get-pip.py \
+ && python -m pip install psutil
+
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+# update password policy
+RUN \
+ sed -i 's/pam_unix.so obscure sha512/pam_unix.so obscure sha512 rounds=12000/' /etc/pam.d/common-password
+
# add netconf user
RUN \
adduser --system netconf && \
COPY --from=o1mediator-build /usr/local/etc/ /usr/local/etc/
COPY --from=o1mediator-build /usr/local/bin/ /usr/local/bin/
COPY --from=o1mediator-build /usr/local/lib/ /usr/local/lib/
+COPY --from=o1mediator-build /usr/local/bin/kubectl /usr/local/bin/kubectl
+
+COPY --from=o1mediator-build /usr/include/libssh/ /usr/include/libssh/
+COPY --from=o1mediator-build /usr/lib/x86_64-linux-gnu/libssh.so.4.* /usr/lib/x86_64-linux-gnu/
+RUN ln -s libssh.so.4 /usr/lib/x86_64-linux-gnu/libssh.so
+
RUN ldconfig
# copy yang models with data