]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
reorganise/regularise dockerfiles, smaller image, args for compiler ver
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Thu, 14 Dec 2017 23:49:02 +0000 (23:49 +0000)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Fri, 15 Dec 2017 22:53:48 +0000 (22:53 +0000)
scripts/docker/build-centos6/Dockerfile.deps
scripts/docker/build-centos7/Dockerfile.deps
scripts/docker/build-debian8/Dockerfile.deps
scripts/docker/build-debian9/Dockerfile.deps
scripts/docker/build-ubuntu14/Dockerfile.deps
scripts/docker/build-ubuntu16/Dockerfile.deps

index 2c115efb8ccb40c3cdd295cb0bf89014bb205e88..5b71a1dff2dc4ca79aa138e7f8068384d5dd3b1a 100644 (file)
@@ -25,7 +25,7 @@ ENV CC=/opt/rh/devtoolset-3/root/usr/bin/gcc
 #  Setup a src dir in /usr/local
 #
 RUN mkdir -p /usr/local/src/repositories
-WORKDIR /usr/local/src
+WORKDIR /usr/local/src/repositories
 
 #
 #  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
@@ -38,13 +38,13 @@ RUN sh cmake.sh --skip-license --prefix=/usr/local
 #  Grab libkqueue and build
 #
 WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
 RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
 WORKDIR libkqueue
 RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
     make && \
-    cpack -G RPM
-RUN yum localinstall -y *.rpm
+    cpack -G RPM && \
+    yum localinstall -y *.rpm
 
 #
 #  Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
@@ -74,23 +74,27 @@ RUN v=$(rpm -q --qf '%{VERSION}\n' --specfile hiredis/redhat/hiredis.spec | head
     rpmbuild -bb hiredis-$v/redhat/hiredis.spec
 RUN yum localinstall -y $HOME/rpmbuild/RPMS/*/hiredis-*.rpm
 
+WORKDIR /usr/local/src/repositories
+
 #
 #  Shallow clone the FreeRADIUS source
 #
-WORKDIR /usr/local/src/repositories
 ARG source=https://github.com/FreeRADIUS/freeradius-server.git
 RUN git clone --depth 1 ${source}
-
 WORKDIR freeradius-server
 
-# Install build dependencies for all branches
+#
+#  Install build dependencies for all branches
+#
 RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
        do \
                git checkout $i; \
                [ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec; \
        done
 
-# Create the build tree
+#
+#  Create the RPM build tree
+#
 ENV BUILDDIR=/root/rpmbuild
 RUN rpmdev-setuptree
 
index e87efd0f7add87edf6833cd748653121eb496c96..bcb2ec054d250119d14f7a14efecf1a0b2979278 100644 (file)
@@ -24,7 +24,7 @@ ENV CC=/opt/rh/devtoolset-3/root/usr/bin/gcc
 #  Setup a src dir in /usr/local
 #
 RUN mkdir -p /usr/local/src/repositories
-WORKDIR /usr/local/src
+WORKDIR /usr/local/src/repositories
 
 #
 #  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
@@ -37,13 +37,13 @@ RUN sh cmake.sh --skip-license --prefix=/usr/local
 #  Grab libkqueue and build
 #
 WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
 RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
 WORKDIR libkqueue
 RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
     make && \
-    cpack -G RPM
-RUN yum localinstall -y *.rpm
+    cpack -G RPM && \
+    yum localinstall -y *.rpm
 
 #
 #  Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
@@ -57,23 +57,27 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project'\
 > /etc/yum.repos.d/ltb-project.repo
 RUN rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project
 
+WORKDIR /usr/local/src/repositories
+
 #
 #  Shallow clone the FreeRADIUS source
 #
-WORKDIR /usr/local/src/repositories
 ARG source=https://github.com/FreeRADIUS/freeradius-server.git
 RUN git clone --depth 1 --no-single-branch ${source}
-
 WORKDIR freeradius-server
 
-# Install build dependencies for all branches
+#
+#  Install build dependencies for all branches
+#
 RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
        do \
                git checkout $i; \
                [ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec; \
        done
 
-# Create the build tree
+#
+#  Create the RPM build tree
+#
 ENV BUILDDIR=/root/rpmbuild
 RUN rpmdev-setuptree
 
index 545d6c55f4552a217c8eb7e26f4bb0baa8e7dc7e..b0187323e87b8dc28a286c13961edf9f5c680780 100644 (file)
@@ -1,43 +1,63 @@
 FROM debian:jessie
 
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=4.9
+ARG clangver=5.0
+ARG osname=jessie
 
 #
-#   For GCC 4.9
+#  Install add-apt-repository
 #
-RUN apt-get install -y g++-4.9
-RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 && update-alternatives --config gcc
+RUN apt-get update && \
+    apt-get install -y software-properties-common && \
+    apt-get clean && \
+    rm -r /var/lib/apt/lists/*
 
-#
-#   For clang 5.0
-#
-RUN add-apt-repository "http://apt.llvm.org/jessie/ llvm-toolchain-jessie-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+#  Requires GCC-4.9 as it has support for C11 keywords and atomics
 
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+#  For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+    apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
+
+RUN apt-get update && \
+#  Development utilities
+    apt-get install -y devscripts equivs git quilt && \
+#  Compilers
+    apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+#  eapol_test dependencies
+    apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+                        --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+    update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+    update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+    update-alternatives --config lldb
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
 
 #
 #  Setup a src dir in /usr/local
 #
+RUN mkdir -p /usr/local/src/repositories
 WORKDIR /usr/local/src/repositories
-RUN git clone --depth=1 --no-single-branch https://github.com/FreeRADIUS/freeradius-server.git
+
+#
+#  Shallow clone the FreeRADIUS source
+#
+ARG source=https://github.com/FreeRADIUS/freeradius-server.git
+RUN git clone --depth 1 --no-single-branch ${source}
 WORKDIR freeradius-server
 
-# Install build dependencies for all branches
+#
+#  Install build dependencies for all branches
+#
 RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
        do \
                git checkout $i; \
-               [ -e ./debian/control.in ] && debian/rules debian/control && echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control; \
+               if [ -e ./debian/control.in ] ; then debian/rules debian/control ; fi ; echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control ; \
        done
 
 ### For some reason this dep was not installed
 # RUN apt-get install -y libiodbc2-dev
-
index bd6f01967aa6a0396e2170c147ecb37169cd5912..2ea2fefc16a15fbfedce5569da8423d1afc419f0 100644 (file)
@@ -1,32 +1,47 @@
 FROM debian:stretch
 
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=6
+ARG clangver=5.0
+ARG osname=stretch
 
 #
-#  Stretch uses GCC 4.9 by default, so we don't need to install any additional compilers to get C11 functionality
+#  Install add-apt-repository
 #
+RUN apt-get update && \
+    apt-get install -y software-properties-common && \
+    apt-get clean && \
+    rm -r /var/lib/apt/lists/*
 
-#
-#  For clang 5.0
-#
-RUN add-apt-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+#  Stretch uses GCC-6.3 by default, so it doesn't need to be updated to get C11 functionality.
 
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+#  For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+    apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
+
+RUN apt-get update && \
+#  Development utilities
+    apt-get install -y devscripts equivs git quilt && \
+#  Compilers
+    apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+#  eapol_test dependencies
+    apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+                        --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+    update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+    update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+    update-alternatives --config lldb
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
 
 #
 #  Setup a src dir in /usr/local
 #
 RUN mkdir -p /usr/local/src/repositories
-WORKDIR /usr/local/src
+WORKDIR /usr/local/src/repositories
 
 #
 #  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
@@ -39,18 +54,19 @@ RUN sh cmake.sh --skip-license --prefix=/usr/local
 #  Grab libkqueue and build
 #
 WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
 RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
 WORKDIR libkqueue
 RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
     make && \
-    cpack -P libkqueue-dev -G DEB
-RUN apt-get install -y ./*.deb
+    cpack -P libkqueue-dev -G DEB && \
+    dpkg -i --force-all ./libkqueue-*deb
+
+WORKDIR /usr/local/src/repositories
 
 #
 #  Shallow clone the FreeRADIUS source
 #
-WORKDIR /usr/local/src/repositories
 ARG source=https://github.com/FreeRADIUS/freeradius-server.git
 RUN git clone --depth 1 --no-single-branch ${source}
 WORKDIR freeradius-server
@@ -61,6 +77,6 @@ WORKDIR freeradius-server
 RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
        do \
                git checkout $i; \
-               [ -e ./debian/control.in ] && debian/rules debian/control && echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control; \
+               if [ -e ./debian/control.in ] ; then debian/rules debian/control ; fi ; echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control ; \
        done
 
index d7fab242df081518a488065c3014d4457f48af9e..d21be7f7cf46cd6e4d077d2cf1b5a4a0f2eea42b 100644 (file)
@@ -1,30 +1,43 @@
 FROM ubuntu:14.04
 
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=4.9
+ARG clangver=5.0
+ARG osname=trusty
 
 #
-#  For GCC 4.9
+#  Install add-apt-repository
 #
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test
-RUN apt-get update
-RUN apt-get install -y g++-4.9
-RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 && update-alternatives --config gcc
+RUN apt-get update && \
+    apt-get install -y software-properties-common python-software-properties && \
+    apt-get clean && \
+    rm -r /var/lib/apt/lists/*
 
-#
-#  For Clang 5.0
-#
-RUN add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trust-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+#  Requires GCC-4.9 as it has support for C11 keywords and atomics
 
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+#  For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+    apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key && \
+#  For GCC
+    add-apt-repository -y ppa:ubuntu-toolchain-r/test
+
+RUN apt-get update && \
+#  Development utilities
+    apt-get install -y devscripts equivs git quilt && \
+#  Compilers
+    apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+#  eapol_test dependencies
+    apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+                        --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+    update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+    update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+    update-alternatives --config lldb
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
 
 #
 #  Setup a src dir in /usr/local
@@ -43,13 +56,14 @@ RUN sh cmake.sh --skip-license --prefix=/usr/local
 #  Grab libkqueue and build
 #
 WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
 RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
 WORKDIR libkqueue
 RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
     make && \
-    cpack -P libkqueue-dev -G DEB
-RUN dpkg -i --force-all ./libkqueue-*deb
+    cpack -P libkqueue-dev -G DEB && \
+    dpkg -i --force-all ./libkqueue-*deb
+
 WORKDIR /usr/local/src/repositories
 
 #
index 088e6332eede3abc91769bbfe8eb4402342fb780..a8900a243ea180ae4f0c4d2f3d41f9ed44774127 100644 (file)
@@ -1,30 +1,43 @@
 FROM ubuntu:16.04
 
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=4.9
+ARG clangver=5.0
+ARG osname=xenial
 
 #
-#  For GCC 4.9
+#  Install add-apt-repository
 #
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test
-RUN apt-get update
-RUN apt-get install -y g++-4.9
-RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 && update-alternatives --config gcc
+RUN apt-get update && \
+    apt-get install -y software-properties-common python-software-properties && \
+    apt-get clean && \
+    rm -r /var/lib/apt/lists/*
 
-#
-#  For clang 5.0
-#
-RUN add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+#  Requires GCC-4.9 as it has support for C11 keywords and atomics
 
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+#  For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+    apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key && \
+#  For GCC
+    add-apt-repository -y ppa:ubuntu-toolchain-r/test
+
+RUN apt-get update && \
+#  Development utilities
+    apt-get install -y devscripts equivs git quilt && \
+#  Compilers
+    apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+#  eapol_test dependencies
+    apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+                        --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+    update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+    update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+    update-alternatives --config lldb
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get -y install libnl-3-dev libnl-genl-3-dev
 
 #
 #  Setup a src dir in /usr/local
@@ -43,13 +56,14 @@ RUN sh cmake.sh --skip-license --prefix=/usr/local
 #  Grab libkqueue and build
 #
 WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
 RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
 WORKDIR libkqueue
 RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
     make && \
-    cpack -P libkqueue-dev -G DEB
-RUN dpkg -i --force-all ./libkqueue-*deb
+    cpack -P libkqueue-dev -G DEB && \
+    dpkg -i --force-all ./libkqueue-*deb
+
 WORKDIR /usr/local/src/repositories
 
 #