Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
FROM ubuntu:20.04
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git \
cmake doxygen valgrind clang autoconf flex bison libreadline-dev \
automake libtool make texinfo pkg-config libpam0g-dev 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 libpcre3-dev libtool m4 debhelper devscripts \
iproute2 llvm libffi-dev
## Installing manual dependencies
# 1. json-c
RUN git clone jsonc
WORKDIR /opt/jsonc
RUN git checkout json-c-0.15
RUN mkdir build
WORKDIR /opt/jsonc/build
RUN cmake \
.. && make && make install
# 2. libyang
RUN git clone libyang
WORKDIR /opt/libyang
RUN git checkout debian/libyang-0.16.105-2
RUN mkdir build
WORKDIR /opt/libyang/build
RUN cmake -D CMAKE_BUILD_TYPE:String="Release" \
make && make install
# libxbgp
RUN git clone libxbgp
WORKDIR /opt/libxbgp
RUN git submodule update --init --recursive
RUN make
# Plugins folder
RUN git clone xbgp_plugins
WORKDIR /opt/xbgp_plugins
RUN make LIBXBGP=/opt/libxbgp/include
# xbgp_bird
RUN git clone xbgp_bird
WORKDIR /opt/xbgp_bird
RUN git checkout xbgp_compliant
RUN autoreconf -i && \
./configure \
--prefix=/usr \
--sysconfdir=/etc/bird \
--localstatedir=/var/run/bird \
--runstatedir=/var/run/bird \
LIBUBPF=/opt/libxbgp \
HUBPF=/opt/libxbgp/include \
XBGP=/opt/xbgp_plugins && \
make && make install
# xbgp_frrouting
# preparing dependencies for FRRouting
RUN groupadd -r -g 92 frr
RUN groupadd -r -g 85 frrvty
RUN adduser --system --ingroup frr --home /var/run/frr/ \
--gecos "FRR suite" --shell /sbin/nologin frr
RUN usermod -a -G frrvty frr
RUN git clone xbgp_frr
WORKDIR /opt/xbgp_frr
RUN git checkout stable/7.3-xbgp
RUN ./ && ./configure \
--prefix=/usr \
--includedir=\${prefix}/include \
--enable-exampledir=\${prefix}/share/doc/frr/examples \
--bindir=\${prefix}/bin \
--sbindir=\${prefix}/lib/frr \
--libdir=\${prefix}/lib/frr \
--libexecdir=\${prefix}/lib/frr \
--localstatedir=/var/run/frr \
--sysconfdir=/etc/frr \
--with-moduledir=\${prefix}/lib/frr/modules \
--with-libyang-pluginsdir=\${prefix}/lib/frr/libyang_plugins \
--enable-configfile-mask=0640 \
--enable-logfile-mask=0640 \
--enable-snmp=agentx \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \
--enable-vty-group=frrvty \
--with-pkg-extra-version=-xbgp \
--enable-systemd=yes \
UBPF_LIB=/opt/libxbgp \
UBPF_INC=/opt/libxbgp/include \
XBGP_INC=/opt/xbgp_plugins && \
make && make install
RUN install -m 775 -o frr -g frr -d /var/log/frr && \
install -m 775 -o frr -g frrvty -d /etc/frr && \
install -m 755 -o frr -g frrvty -d /etc/frr/plugins && \
install -m 640 -o frr -g frrvty tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf && \
install -m 640 -o frr -g frr tools/etc/frr/frr.conf /etc/frr/frr.conf && \
install -m 640 -o frr -g frr tools/etc/frr/daemons.conf /etc/frr/daemons.conf && \
install -m 640 -o frr -g frr tools/etc/frr/manifest.json /etc/frr/plugins/manifest.json && \
install -m 640 -o frr -g frr tools/etc/frr/extra_conf.json /etc/frr/plugins/extra_conf.json && \
install -m 640 -o frr -g frr tools/etc/frr/daemons /etc/frr/daemons
# this helper is used to launch the protocol of your choice
# Usage example :
# ./xproto frr start # will launch frrouting
# USAGE: xproto [frr|bird] [start|stop]
COPY ./xproto /usr/bin/xproto
# This is an example
# We now show how to load a plugin on FRR BGP at startup time
# first you'll need a manifest that will contains pluginst to be loaded
# We will use the one located at /opt/xbgp_plugins/hello_world/manifest.json
RUN cp /opt/xbgp_plugins/hello_world/manifest.json /etc/frr/plugins/manifest.conf
# we add the compiled plugin to the same folder as the manifest
RUN cp /opt/xbgp_plugins/hello_world/reject_route_attr_42.o /etc/frr/plugins
CMD /bin/bash