diff options
author | 2019-04-26 13:15:56 +0200 | |
---|---|---|
committer | 2019-04-26 15:28:53 +0200 | |
commit | 9ab1c9c9bd83c971971d3fe5ddf4151717847bf5 (patch) | |
tree | 2b6c570a80981b1dfeca1cc34c6d5b9b4a44a4d9 | |
parent | 0d9d6a9a4446743cc9ac601a76b7e8594c3600ec (diff) |
This patch fixes docker env and dependencies
-Modify Dockerfile to build our own image of sysrepo with netopeer2
-Add missing pkg-config dependency to compile netopeer2 from ubuntu
-Fix typo in makefile for LIBSSH dependency
-Install protobuf then grpc in install-dep-gnmi-extra in Makefile
Change-Id: I5b8a64cc29cf67f7dd7ff439f80ea77844632435
Signed-off-by: YohanPipereau <ypiperea@cisco.com>
-rw-r--r-- | Dockerfile | 18 | ||||
-rw-r--r-- | Makefile | 21 |
2 files changed, 25 insertions, 14 deletions
@@ -1,14 +1,18 @@ -FROM sysrepo/sysrepo-netopeer2:v0.7.7 +FROM ubuntu:18.04 -# Layer1: Prepare sweetcomb environement by installing sysrepo, netopeer2 & vpp +# Layer0: Prepare sweetcomb environement by installing sysrepo, netopeer2 & vpp +# Layer1: Install vpp # Layer2: Install sweetcomb - -#Clean sysrepo previous build because they forgot to do it +#Layer 0 +RUN mkdir -p /opt/dev && apt-get update && apt-get install -y build-essential sudo +COPY . /opt/dev +WORKDIR /opt/dev +RUN make install-dep && make install-dep-extra RUN rm -rf /opt/dev/* -#Install VPP -RUN apt-get update && apt-get install -y \ +#Layer1 +RUN apt-get install -y \ #build utils sudo curl \ #test utils @@ -16,7 +20,7 @@ RUN apt-get update && apt-get install -y \ && curl -s https://packagecloud.io/install/repositories/fdio/1904/script.deb.sh | sudo bash \ && apt-get -y --force-yes install vpp libvppinfra* vpp-plugin-* vpp-dev -# Install sweetcomb +#Layer2 COPY . /root/src/sweetcomb WORKDIR /root/src/sweetcomb @@ -52,7 +52,7 @@ endif #Dependencies to build BUILD_DEB = curl build-essential autoconf automake ccache git cmake wget coreutils #Dependencies for netopeer2 -NETOPEER2_DEB = libssl-dev +NETOPEER2_DEB = libssl-dev pkgconf #Dependencies for checkstyle CHECKSTYLE_DEB = indent #Dependencies for scvpp @@ -62,8 +62,7 @@ SYSREPO_DEB = libev-dev libavl-dev bison flex libpcre3-dev libprotobuf-c-dev pro #Dependencies of libssh LIBSSH_DEB = zlib1g-dev #Sum dependencies -DEB_DEPENDS = ${BUILD_DEB} ${NETOPEER2_DEB} ${CHECKSTYLE_DEB} ${SCVPP_DEB} \ - ${SYSREPO_DEB} ${LIBSSH-DEB} +DEB_DEPENDS = ${BUILD_DEB} ${NETOPEER2_DEB} ${CHECKSTYLE_DEB} ${SCVPP_DEB} ${SYSREPO_DEB} ${LIBSSH_DEB} #Dependencies for grpc DEB_GNMI_DEPENDS = libpugixml-dev libjsoncpp-dev libtool pkg-config @@ -127,11 +126,19 @@ else endif _libssh: +ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID)) + mkdir -p $(BR)/downloads/&&cd $(BR)/downloads/\ + &&wget https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.7.7.tar.gz\ + &&tar xvf libssh-0.7.7.tar.gz && cd libssh-0.7.7 && mkdir build && cd build\ + &&cmake -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.so -DZLIB_INCLUDE_DIR=/usr/include/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr ..\ + &&make -j$(nproc) &&sudo make install && sudo ldconfig&&cd ../../; +else ifeq ($(OS_ID),centos) mkdir -p $(BR)/downloads/&&cd $(BR)/downloads/\ &&wget https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.7.7.tar.gz\ &&tar xvf libssh-0.7.7.tar.gz && cd libssh-0.7.7 && mkdir build && cd build\ &&cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr ..\ - &&make -j$(nproc) &&sudo make install && sudo ldconfig&&cd ../../; \ + &&make -j$(nproc) &&sudo make install && sudo ldconfig&&cd ../../; +endif _libyang: @mkdir -p $(BR)/downloads/&&cd $(BR)/downloads/\ @@ -201,12 +208,12 @@ else endif @rm -rf $(BR)/downloads @mkdir -p $(BR)/downloads/&&cd $(BR)/downloads/\ - && git clone --depth=1 -b v1.16.0 https://github.com/grpc/grpc \ + && git clone --depth=1 -b v1.16.1 https://github.com/grpc/grpc \ && cd grpc && git submodule update --init \ - && make && make install \ && cd third_party/protobuf \ && ./autogen.sh && ./configure && make install \ - &&cd ../../.. && rm -rf $(BR)/downloads + && cd ../.. make && make install \ + &&cd .. && rm -rf $(BR)/downloads install-vpp: @echo "please install vpp as vpp's guide from source if failed" |