summaryrefslogtreecommitdiffstats
path: root/docker/ubuntu20-ci/Dockerfile
blob: 8a4a156a51519c201f8d24c1042ce9dc4ab840f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM ubuntu:20.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 curl libtool make libreadline-dev texinfo \
      pkg-config libpam0g-dev libjson-c-dev bison flex python3-pytest \
      libc-ares-dev python3-dev libsystemd-dev python-ipaddress python3-sphinx \
      install-info build-essential libsystemd-dev libsnmp-dev perl \
      libcap-dev python2 libelf-dev \
      sudo gdb curl iputils-ping time \
      mininet iproute2 iperf libpcre2-dev \
      libpcre3-dev \
      && \
    curl -fLO https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/Ubuntu-20.04-x86_64-Packages/libyang2_2.0.0.10.g2eb910e4-1_amd64.deb && \
    curl -fLO https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/Ubuntu-20.04-x86_64-Packages/libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
    dpkg -i libyang2_2.0.0.10.g2eb910e4-1_amd64.deb libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
    rm -f libyang2_2.0.0.10.g2eb910e4-1_amd64.deb libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
      curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py && \
      python2 /tmp/get-pip.py && \
      rm -f  /tmp/get-pip.py && \
      pip2 install ipaddr && \
      pip2 install "pytest<5" && \
      pip2 install "scapy>=2.4.2" && \
      pip2 install exabgp==3.4.17

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

USER frr:frr

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/ubuntu20-ci/docker-start /usr/sbin/docker-start
CMD ["/usr/sbin/docker-start"]