]> git.proxmox.com Git - mirror_frr.git/commitdiff
docker: Create build for CentOS 8
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Fri, 27 Dec 2019 12:08:31 +0000 (14:08 +0200)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Fri, 27 Dec 2019 12:41:39 +0000 (14:41 +0200)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
docker/centos-7/Dockerfile [new file with mode: 0644]
docker/centos-7/build.sh [new file with mode: 0755]
docker/centos-7/docker-start [new file with mode: 0755]
docker/centos-8/Dockerfile [new file with mode: 0644]
docker/centos-8/build.sh [new file with mode: 0755]
docker/centos-8/docker-start [new file with mode: 0755]
docker/centos/Dockerfile [deleted file]
docker/centos/build.sh [deleted file]
docker/centos/docker-start [deleted file]

diff --git a/docker/centos-7/Dockerfile b/docker/centos-7/Dockerfile
new file mode 100644 (file)
index 0000000..a8564bd
--- /dev/null
@@ -0,0 +1,43 @@
+# This stage builds an rpm from the source
+FROM centos:centos7 as centos-7-builder
+
+RUN yum install -y rpm-build autoconf automake libtool make \
+        readline-devel texinfo net-snmp-devel groff pkgconfig \
+        json-c-devel pam-devel bison flex pytest c-ares-devel \
+        python-devel systemd-devel python-sphinx libcap-devel \
+        https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.x86_64.rpm \
+        https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-devel-0.16.111-0.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:centos7
+RUN mkdir -p /pkgs/rpm \
+    && yum install -y https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.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-7-builder /rpmbuild/RPMS/ /pkgs/rpm/
+
+RUN yum install -y /pkgs/rpm/*/*.rpm \
+    && rm -rf /pkgs
+COPY docker/centos-7/docker-start /usr/lib/frr/docker-start
+ENTRYPOINT [ "/usr/lib/frr/docker-start" ]
diff --git a/docker/centos-7/build.sh b/docker/centos-7/build.sh
new file mode 100755 (executable)
index 0000000..b3022d7
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+
+##
+# Package version needs to be decimal
+##
+GITREV="$(git rev-parse --short=10 HEAD)"
+PKGVER="$(printf '%u\n' 0x$GITREV)"
+
+mkdir -p docker/centos-7/pkgs
+docker build \
+       --file=docker/centos-7/Dockerfile \
+       --build-arg="PKGVER=$PKGVER" \
+       --tag="frr:centos-7-builder-$GITREV" \
+       --target=centos-7-builder \
+       .
+
+# Copy RPM package from container to host
+CONTAINER_ID="$(docker create "frr:centos-7-builder-$GITREV")"
+docker cp "${CONTAINER_ID}:/rpmbuild/RPMS/x86_64/" docker/centos-7/pkgs
+docker rm "${CONTAINER_ID}"
+
+docker build \
+       --cache-from="frr:centos-7-builder-$GITREV" \
+       --file=docker/centos-7/Dockerfile \
+       --build-arg="PKGVER=$PKGVER" \
+       --tag="frr:centos-7-$GITREV" \
+       .
+
+docker rmi "frr:centos-7-builder-$GITREV"
diff --git a/docker/centos-7/docker-start b/docker/centos-7/docker-start
new file mode 100755 (executable)
index 0000000..a391324
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+##
+# Change owner for docker volume mount
+##
+chown -R frr:frr /etc/frr
+/usr/lib/frr/frrinit.sh start
+
+# Sleep forever
+exec tail -f /dev/null
diff --git a/docker/centos-8/Dockerfile b/docker/centos-8/Dockerfile
new file mode 100644 (file)
index 0000000..6c1f873
--- /dev/null
@@ -0,0 +1,46 @@
+# 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 python2-pytest \
+        c-ares-devel python2-devel systemd-devel libcap-devel platform-python-devel \
+        https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.x86_64.rpm \
+        https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-devel-0.16.111-0.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
+
+RUN pip2 install sphinx
+
+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-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.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
+COPY docker/centos-8/docker-start /usr/lib/frr/docker-start
+ENTRYPOINT [ "/usr/lib/frr/docker-start" ]
diff --git a/docker/centos-8/build.sh b/docker/centos-8/build.sh
new file mode 100755 (executable)
index 0000000..968d5fe
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+
+##
+# Package version needs to be decimal
+##
+GITREV="$(git rev-parse --short=10 HEAD)"
+PKGVER="$(printf '%u\n' 0x$GITREV)"
+
+mkdir -p docker/centos-8/pkgs
+docker build \
+       --file=docker/centos-8/Dockerfile \
+       --build-arg="PKGVER=$PKGVER" \
+       --tag="frr:centos-8-builder-$GITREV" \
+       --target=centos-8-builder \
+       .
+
+# Copy RPM package from container to host
+CONTAINER_ID="$(docker create "frr:centos-builder-8-$GITREV")"
+docker cp "${CONTAINER_ID}:/rpmbuild/RPMS/x86_64/" docker/centos-8/pkgs
+docker rm "${CONTAINER_ID}"
+
+docker build \
+       --cache-from="frr:centos-8-builder-$GITREV" \
+       --file=docker/centos-8/Dockerfile \
+       --build-arg="PKGVER=$PKGVER" \
+       --tag="frr:centos-8-$GITREV" \
+       .
+
+docker rmi "frr:centos-8-builder-$GITREV"
diff --git a/docker/centos-8/docker-start b/docker/centos-8/docker-start
new file mode 100755 (executable)
index 0000000..935b222
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+chown -R frr:frr /etc/frr
+/usr/lib/frr/frrinit.sh start
+
+# Sleep forever
+exec tail -f /dev/null
diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile
deleted file mode 100644 (file)
index 088a320..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# This stage builds an rpm from the source
-FROM centos:centos7 as centos-builder
-
-RUN yum install -y rpm-build autoconf automake libtool make \
-        readline-devel texinfo net-snmp-devel groff pkgconfig \
-        json-c-devel pam-devel bison flex pytest c-ares-devel \
-        python-devel systemd-devel python-sphinx libcap-devel \
-        https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.x86_64.rpm \
-        https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-devel-0.16.111-0.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:centos7
-RUN mkdir -p /pkgs/rpm \
-    && yum install -y https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.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-builder /rpmbuild/RPMS/ /pkgs/rpm/
-
-RUN yum install -y /pkgs/rpm/*/*.rpm \
-    && rm -rf /pkgs
-COPY docker/centos/docker-start /usr/lib/frr/docker-start
-ENTRYPOINT [ "/usr/lib/frr/docker-start" ]
diff --git a/docker/centos/build.sh b/docker/centos/build.sh
deleted file mode 100755 (executable)
index 9cd0f61..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-set -e
-
-##
-# Package version needs to be decimal
-##
-GITREV="$(git rev-parse --short=10 HEAD)"
-PKGVER="$(printf '%u\n' 0x$GITREV)"
-
-mkdir -p docker/centos/pkgs
-docker build \
-       --file=docker/centos/Dockerfile \
-       --build-arg="PKGVER=$PKGVER" \
-       --tag="frr:centos-builder-$GITREV" \
-       --target=centos-builder \
-       .
-
-# Copy RPM package from container to host
-CONTAINER_ID="$(docker create "frr:centos-builder-$GITREV")"
-docker cp "${CONTAINER_ID}:/rpmbuild/RPMS/x86_64/" docker/centos/pkgs
-docker rm "${CONTAINER_ID}"
-
-docker build \
-       --cache-from="frr:centos-builder-$GITREV" \
-       --file=docker/centos/Dockerfile \
-       --build-arg="PKGVER=$PKGVER" \
-       --tag="frr:centos-$GITREV" \
-       .
-
-docker rmi "frr:centos-builder-$GITREV"
diff --git a/docker/centos/docker-start b/docker/centos/docker-start
deleted file mode 100755 (executable)
index a391324..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-##
-# Change owner for docker volume mount
-##
-chown -R frr:frr /etc/frr
-/usr/lib/frr/frrinit.sh start
-
-# Sleep forever
-exec tail -f /dev/null