summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Dockerfile18
-rw-r--r--Makefile21
2 files changed, 25 insertions, 14 deletions
diff --git a/Dockerfile b/Dockerfile
index 255d7e4..1354f5c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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
diff --git a/Makefile b/Makefile
index 4eb02a3..bd9ad05 100644
--- a/Makefile
+++ b/Makefile
@@ -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"