summaryrefslogtreecommitdiffstats
path: root/docker/ubuntu18-ci/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'docker/ubuntu18-ci/Dockerfile')
-rw-r--r--docker/ubuntu18-ci/Dockerfile73
1 files changed, 73 insertions, 0 deletions
diff --git a/docker/ubuntu18-ci/Dockerfile b/docker/ubuntu18-ci/Dockerfile
new file mode 100644
index 0000000..07a5a2f
--- /dev/null
+++ b/docker/ubuntu18-ci/Dockerfile
@@ -0,0 +1,73 @@
+FROM ubuntu:18.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
+# Update Ubuntu Software repository
+RUN apt update && \
+ apt-get install -y \
+ git autoconf automake libtool make libreadline-dev texinfo \
+ pkg-config libpam0g-dev libjson-c-dev bison flex python3-pip \
+ libc-ares-dev python3-dev python3-sphinx \
+ install-info build-essential libsnmp-dev perl libcap-dev \
+ libelf-dev \
+ sudo gdb iputils-ping time \
+ python-pip net-tools iproute2 && \
+ python3 -m pip install wheel && \
+ python3 -m pip install pytest && \
+ python3 -m pip install pytest-xdist && \
+ python3 -m pip install "scapy>=2.4.2" && \
+ python3 -m pip install xmltodict && \
+ python2 -m pip install 'exabgp<4.0.0'
+
+RUN groupadd -r -g 92 frr && \
+ groupadd -r -g 85 frrvty && \
+ adduser --system --ingroup frr --home /home/frr \
+ --gecos "FRR suite" --shell /bin/bash frr && \
+ usermod -a -G frrvty frr && \
+ useradd -d /var/run/exabgp/ -s /bin/false exabgp && \
+ echo 'frr ALL = NOPASSWD: ALL' | tee /etc/sudoers.d/frr && \
+ mkdir -p /home/frr && chown frr.frr /home/frr
+
+#for libyang 2
+RUN apt-get install -y cmake libpcre2-dev
+
+USER frr:frr
+
+# build and install libyang2
+RUN cd && pwd && ls -al && \
+ git clone https://github.com/CESNET/libyang.git && \
+ cd libyang && \
+ git checkout v2.0.0 && \
+ mkdir build; cd build && \
+ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+ -DCMAKE_BUILD_TYPE:String="Release" .. && \
+ make -j $(nproc) && \
+ sudo make install
+
+COPY --chown=frr:frr . /home/frr/frr/
+
+RUN cd && ls -al && ls -al frr
+
+RUN cd ~/frr && \
+ ./bootstrap.sh && \
+ ./configure \
+ --prefix=/usr \
+ --localstatedir=/var/run/frr \
+ --sbindir=/usr/lib/frr \
+ --sysconfdir=/etc/frr \
+ --enable-vtysh \
+ --enable-pimd \
+ --enable-sharpd \
+ --enable-multipath=64 \
+ --enable-user=frr \
+ --enable-group=frr \
+ --enable-vty-group=frrvty \
+ --enable-snmp=agentx \
+ --with-pkg-extra-version=-my-manual-build && \
+ make -j $(nproc) && \
+ sudo make install
+
+RUN cd ~/frr && make check || true
+
+COPY docker/ubuntu18-ci/docker-start /usr/sbin/docker-start
+CMD ["/usr/sbin/docker-start"]