blob: 71378c24514c45f877703ac622f41825242ab8a1 (
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
|
# This stage builds an rpm from the source
FROM centos:centos8 as centos-8-builder
RUN dnf install --enablerepo=powertools -y rpm-build git autoconf pcre-devel \
automake libtool make readline-devel texinfo net-snmp-devel pkgconfig \
groff pkgconfig json-c-devel pam-devel bison flex python3-pytest \
c-ares-devel python3-devel python3-sphinx libcap-devel platform-python-devel \
https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-devel-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-110/CentOS-7-x86_64-Packages/librtr-0.7.0-1.el7.centos.x86_64.rpm \
https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-110/CentOS-7-x86_64-Packages/librtr-devel-0.7.0-1.el7.centos.x86_64.rpm
COPY . /src
ARG PKGVER
RUN echo '%_smp_mflags %( echo "-j$(/usr/bin/getconf _NPROCESSORS_ONLN)"; )' >> /root/.rpmmacros \
&& cd /src \
&& ./bootstrap.sh \
&& ./configure \
--enable-rpki \
--enable-numeric-version \
--with-pkg-extra-version="_git$PKGVER" \
&& make dist \
&& cd / \
&& mkdir -p /rpmbuild/{SOURCES,SPECS} \
&& cp /src/frr*.tar.gz /rpmbuild/SOURCES \
&& cp /src/redhat/frr.spec /rpmbuild/SPECS \
&& rpmbuild \
--define "_topdir /rpmbuild" \
-ba /rpmbuild/SPECS/frr.spec
# This stage installs frr from the rpm
FROM centos:centos8
RUN mkdir -p /pkgs/rpm \
&& yum install -y https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-110/CentOS-7-x86_64-Packages/librtr-0.7.0-1.el7.centos.x86_64.rpm
COPY --from=centos-8-builder /rpmbuild/RPMS/ /pkgs/rpm/
RUN yum install -y /pkgs/rpm/*/*.rpm \
&& rm -rf /pkgs
# Own the config / PID files
RUN mkdir -p /var/run/frr
RUN chown -R frr:frr /etc/frr /var/run/frr
# Add tini because no CentOS8 package
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
RUN chmod +x /sbin/tini
# Simple init manager for reaping processes and forwarding signals
ENTRYPOINT ["/sbin/tini", "--"]
# Default CMD starts watchfrr
COPY docker/centos-8/docker-start /usr/lib/frr/docker-start
CMD ["/usr/lib/frr/docker-start"]
|