]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rework dockerfiles
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Thu, 26 Oct 2017 21:28:09 +0000 (22:28 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Thu, 26 Oct 2017 21:55:33 +0000 (22:55 +0100)
24 files changed:
scripts/docker/README.md
scripts/docker/build-centos6/Dockerfile
scripts/docker/build-centos6/Dockerfile.jenkins [new file with mode: 0644]
scripts/docker/build-centos6/Dockerfile.source [new file with mode: 0644]
scripts/docker/build-centos7/Dockerfile
scripts/docker/build-centos7/Dockerfile.jenkins [new file with mode: 0644]
scripts/docker/build-centos7/Dockerfile.source [new file with mode: 0644]
scripts/docker/build-debian7/Dockerfile
scripts/docker/build-debian7/Dockerfile.jenkins [new file with mode: 0644]
scripts/docker/build-debian7/Dockerfile.source [new file with mode: 0644]
scripts/docker/build-debian8/Dockerfile
scripts/docker/build-debian8/Dockerfile.jenkins [new file with mode: 0644]
scripts/docker/build-debian8/Dockerfile.source [new file with mode: 0644]
scripts/docker/build-debian9/Dockerfile
scripts/docker/build-debian9/Dockerfile.jenkins [new file with mode: 0644]
scripts/docker/build-debian9/Dockerfile.source [new file with mode: 0644]
scripts/docker/build-debian9/README [new file with mode: 0644]
scripts/docker/build-ubuntu14/Dockerfile
scripts/docker/build-ubuntu14/Dockerfile.jenkins [new file with mode: 0644]
scripts/docker/build-ubuntu14/Dockerfile.source [new file with mode: 0644]
scripts/docker/build-ubuntu16/Dockerfile
scripts/docker/build-ubuntu16/Dockerfile.jenkins [new file with mode: 0644]
scripts/docker/build-ubuntu16/Dockerfile.source [new file with mode: 0644]
scripts/docker/dockerbuild [new file with mode: 0755]

index c32b2ca0c492409c46c4307526f714ed2f4c1f53..8146dd7c43a7b31bb4bddf4a21041c1571dd6fa4 100644 (file)
@@ -10,6 +10,18 @@ party developers may also find them useful if they're shipping their
 own packages, or performing debugging on behalf of the development
 team.
 
+Each directory has several dockerfiles:
+
+ - Dockerfile.source will build an image which has full
+   dependencies installed, ready for building FreeRADIUS.
+
+ - Dockerfile is based on Dockerfile.source and will build
+   the FreeRADIUS source and run the server.
+
+ - Dockerfile.jenkins is based on Dockerfile.source and
+   will add components required for use in a jenkins build
+   environment.
+
 ## Getting started
 
 ### Building
@@ -18,7 +30,7 @@ As with any Dockerfile you'll first need to build the image:
 
 ```bash
 cd scripts/docker/build-<os_name>
-docker build -t freeradius/<os_name>-build .
+docker build -f Dockerfile.source -t freeradius/<os_name>-source .
 ```
 
 This will download the OS base image, install/build any dependencies
@@ -31,28 +43,57 @@ Once built, running ``docker images`` should show the image.
 ```bash
 $ docker images
 REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
-freeradius/centos7-build   latest              0b7af2e27bef        10 minutes ago      2.15 GB
+freeradius/centos7-source  latest              0b7af2e27bef        10 minutes ago      2.15 GB
 centos                     centos7             3bee3060bfc8        2 weeks ago         193 MB
 ```
-
 You will now be able to execute the built image with an interactive
 shell from which you can perform debugging or build packages.
 
+From this base source image, the other images can be built. To
+compile and run FreeRADIUS:
+
+```bash
+docker build -t freeradius:<os_name> .
+docker run freeradius:<os_name>
+```
+
+To build the jenkins image:
+
+```bash
+docker build -f Dockerfile.jenkins -t freeradius:<os_name>-jenkins .
+```
+
+Building all these docker images can be done with the supplied
+script, for example:
+
+```bash
+$ ./dockerbuild build-centos7
+```
+
 ### Running
 
 The ``docker run`` command is used to create new containers from
 images.  The command takes flags, and an image identifier.  In the
-example below the ``-it`` flags tell docker to operan an interactive
+example below the ``-it`` flags tell docker to open an interactive
 terminal on the container.
 
 ```bash
-$ docker run -it freeradius/centos7-build
+$ docker run -it freeradius/centos7-source
 [root@08a222f5fdfe freeradius-server]# ls
 acinclude.m4  config.guess  configure.ac  debian      install-sh  main.mk      man      raddb      scripts  suse
 aclocal.m4    config.sub    COPYRIGHT     doc         LICENSE     Makefile     mibs     README.md  share    VERSION
 autogen.sh    configure     CREDITS       INSTALL.md  m4          Make.inc.in  missing  redhat     src
 ```
 
+To run FreeRADIUS, use:
+
+```bash
+$ docker run freeradius/centos7
+Info  : FreeRADIUS Version 4.0.0
+Info  : Copyright (C) 1999-2017 The FreeRADIUS server project and contributors
+...
+```
+
 When ``docker run`` is used to execute an image a new container is
 created from the image.  This stores any changes you make, whilst
 leaving the original container image unchanged.
@@ -91,4 +132,3 @@ See
 [here](https://docs.docker.com/engine/userguide/networking/#embedded-dns-server)
 for more details on docker networking.
 
-
index 760bb1bb51b98e154fb2a141a70f38348a1107c4..b0cdf2f1cea4ceb3a9e47e7bea2cc91976d83375 100644 (file)
-FROM centos:centos6
+FROM freeradius/centos6-source
 
-#
-#  Install devtools like Make and git
-#
-RUN yum groupinstall -y "Development Tools"
-RUN yum install -y rpmdevtools
-RUN yum install -y vim emacs nano
-RUN yum install -y openssl
-RUN yum install -y yum-utils
+WORKDIR /usr/local/src/repositories/freeradius-server
+RUN ./configure --prefix=/opt/freeradius
+RUN make -j2
+RUN make install
+WORKDIR /opt/freeradius/etc/raddb
+RUN sed -i -e 's/allow_vulnerable_openssl.*/allow_vulnerable_openssl = yes/' radiusd.conf
+WORKDIR certs
+RUN make
+WORKDIR /
 
-#
-#  Add the EPEL repository for freetds and hiredis
-#
-RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
+EXPOSE 1812/udp 1813/udp
+CMD ["/opt/freeradius/sbin/radiusd", "-X"]
 
-#
-#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
-#
-RUN yum install -y centos-release-scl
-RUN yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++
-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
-
-#
-#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
-#
-RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
-RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
-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 patch-3 --depth=1 https://github.com/arr2036/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
-
-#
-#  Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
-#
-RUN echo $'[ltb-project]\n\
-name=LTB project packages\n\
-baseurl=https://ltb-project.org/rpm/$releasever/$basearch\n\
-enabled=1\n\
-gpgcheck=1\n\
-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
-
-#
-#  Build hiredis packages manually as the version available is too old
-#
-WORKDIR /usr/local/src/repositories
-RUN git clone --depth=1 https://github.com/mattrose/hiredis.git
-WORKDIR hiredis
-RUN git checkout rpm
-WORKDIR /usr/local/src/repositories
-RUN mkdir -p $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
-RUN yum-builddep -y hiredis/redhat/hiredis.spec
-RUN v=$(rpm -q --qf '%{VERSION}\n' --specfile hiredis/redhat/hiredis.spec | head -1) ;\
-    mv hiredis hiredis-$v ;\
-    tar -c -z -f $HOME/rpmbuild/SOURCES/hiredis-$v.tar.gz --exclude=.git hiredis-$v ;\
-    rpmbuild -bb hiredis-$v/redhat/hiredis.spec 
-RUN yum localinstall -y $HOME/rpmbuild/RPMS/*/hiredis-*.rpm
-
-#
-#  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
-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
-ENV BUILDDIR=/root/rpmbuild
-RUN rpmdev-setuptree
-
-#
-#  This is necessary for the jenkins server to talk to the docker instance
-#
-RUN yum install -y openssh-server java-1.8.0-openjdk-headless createrepo
-RUN adduser jenkins
-RUN printf jenkins1 | passwd --stdin jenkins
-RUN mkdir /var/run/sshd
-RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
-RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
-EXPOSE 22
-CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-centos6/Dockerfile.jenkins b/scripts/docker/build-centos6/Dockerfile.jenkins
new file mode 100644 (file)
index 0000000..32b9ce5
--- /dev/null
@@ -0,0 +1,14 @@
+FROM freeradius/centos6-source
+
+#
+#  This is necessary for the jenkins server to talk to the docker instance
+#
+RUN yum install -y openssh-server java-1.8.0-openjdk-headless createrepo
+RUN adduser jenkins
+RUN printf jenkins1 | passwd --stdin jenkins
+RUN mkdir /var/run/sshd
+RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-centos6/Dockerfile.source b/scripts/docker/build-centos6/Dockerfile.source
new file mode 100644 (file)
index 0000000..ea3f5a7
--- /dev/null
@@ -0,0 +1,96 @@
+FROM centos:centos6
+
+#
+#  Install devtools like Make and git
+#
+RUN yum groupinstall -y "Development Tools"
+RUN yum install -y rpmdevtools
+RUN yum install -y vim emacs nano
+RUN yum install -y openssl
+RUN yum install -y yum-utils
+
+#
+#  Add the EPEL repository for freetds and hiredis
+#
+RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
+
+#
+#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
+#
+RUN yum install -y centos-release-scl
+RUN yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++
+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
+
+#
+#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
+#
+RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
+RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
+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 patch-3 --depth=1 https://github.com/arr2036/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
+
+#
+#  Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
+#
+RUN echo $'[ltb-project]\n\
+name=LTB project packages\n\
+baseurl=https://ltb-project.org/rpm/$releasever/$basearch\n\
+enabled=1\n\
+gpgcheck=1\n\
+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
+
+#
+#  Build hiredis packages manually as the version available is too old
+#
+WORKDIR /usr/local/src/repositories
+RUN git clone --depth=1 https://github.com/mattrose/hiredis.git
+WORKDIR hiredis
+RUN git checkout rpm
+WORKDIR /usr/local/src/repositories
+RUN mkdir -p $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
+RUN yum-builddep -y hiredis/redhat/hiredis.spec
+RUN v=$(rpm -q --qf '%{VERSION}\n' --specfile hiredis/redhat/hiredis.spec | head -1) ;\
+    mv hiredis hiredis-$v ;\
+    tar -c -z -f $HOME/rpmbuild/SOURCES/hiredis-$v.tar.gz --exclude=.git hiredis-$v ;\
+    rpmbuild -bb hiredis-$v/redhat/hiredis.spec 
+RUN yum localinstall -y $HOME/rpmbuild/RPMS/*/hiredis-*.rpm
+
+#
+#  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
+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
+ENV BUILDDIR=/root/rpmbuild
+RUN rpmdev-setuptree
+
index ebddb6c431da1ed3031a9de13e0c937fb1d194a9..d9a63dfef523a3ef7f068b7bfa1b5bb78008ac6f 100644 (file)
@@ -1,90 +1,15 @@
-FROM centos:centos7
+FROM freeradius/centos7-source
 
-#
-#  Install devtools like Make and git
-#
-RUN yum groupinstall -y "Development Tools"
-RUN yum install -y rpmdevtools
-RUN yum install -y vim emacs nano
-RUN yum install -y openssl
+WORKDIR /usr/local/src/repositories/freeradius-server
+RUN ./configure --prefix=/opt/freeradius
+RUN make -j2
+RUN make install
+WORKDIR /opt/freeradius/etc/raddb
+RUN sed -i -e 's/allow_vulnerable_openssl.*/allow_vulnerable_openssl = yes/' radiusd.conf
+WORKDIR certs
+RUN make
+WORKDIR /
 
-#
-#  Add the EPEL repository for freetds and hiredis
-#
-RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+EXPOSE 1812/udp 1813/udp
+CMD ["/opt/freeradius/sbin/radiusd", "-X"]
 
-#
-#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
-#
-RUN yum install -y centos-release-scl
-RUN yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++
-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
-
-#
-#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
-#
-RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
-RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
-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 patch-3 --depth=1 https://github.com/arr2036/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
-
-#
-#  Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
-#
-RUN echo $'[ltb-project]\n\
-name=LTB project packages\n\
-baseurl=https://ltb-project.org/rpm/$releasever/$basearch\n\
-enabled=1\n\
-gpgcheck=1\n\
-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
-
-#
-#  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
-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
-ENV BUILDDIR=/root/rpmbuild
-RUN rpmdev-setuptree
-
-#
-#  This is necessary for the jenkins server to talk to the docker instance
-#
-RUN yum install -y openssh-server java-1.8.0-openjdk-headless createrepo
-RUN adduser jenkins
-RUN printf jenkins1 | passwd --stdin jenkins
-RUN mkdir /var/run/sshd
-RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
-RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
-EXPOSE 22
-CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-centos7/Dockerfile.jenkins b/scripts/docker/build-centos7/Dockerfile.jenkins
new file mode 100644 (file)
index 0000000..88c57e1
--- /dev/null
@@ -0,0 +1,14 @@
+FROM freeradius/centos7-source
+
+#
+#  This is necessary for the jenkins server to talk to the docker instance
+#
+RUN yum install -y openssh-server java-1.8.0-openjdk-headless createrepo
+RUN adduser jenkins
+RUN printf jenkins1 | passwd --stdin jenkins
+RUN mkdir /var/run/sshd
+RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-centos7/Dockerfile.source b/scripts/docker/build-centos7/Dockerfile.source
new file mode 100644 (file)
index 0000000..5ebd428
--- /dev/null
@@ -0,0 +1,79 @@
+FROM centos:centos7
+
+#
+#  Install devtools like Make and git
+#
+RUN yum groupinstall -y "Development Tools"
+RUN yum install -y rpmdevtools
+RUN yum install -y vim emacs nano
+RUN yum install -y openssl
+
+#
+#  Add the EPEL repository for freetds and hiredis
+#
+RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+
+#
+#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
+#
+RUN yum install -y centos-release-scl
+RUN yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++
+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
+
+#
+#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
+#
+RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
+RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
+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 patch-3 --depth=1 https://github.com/arr2036/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
+
+#
+#  Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
+#
+RUN echo $'[ltb-project]\n\
+name=LTB project packages\n\
+baseurl=https://ltb-project.org/rpm/$releasever/$basearch\n\
+enabled=1\n\
+gpgcheck=1\n\
+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
+
+#
+#  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
+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
+ENV BUILDDIR=/root/rpmbuild
+RUN rpmdev-setuptree
+
index a461e422f24617ea4de0bfe89bb1118799bdecac..a4670c9805bec7cbc40b494d03683130383d3e02 100644 (file)
@@ -1,37 +1,16 @@
-FROM debian:wheezy
-RUN apt-get update && apt-get install -y sudo firebird-dev freetds-dev libcap-dev libcollectdclient-dev libcurl4-openssl-dev libgdbm-dev libhiredis-dev libidn11-dev libiodbc2-dev libjson0-dev libldap2-dev libpq-dev libmemcached-dev libmysqlclient-dev libpam0g-dev libpcap-dev libperl-dev libsqlite3-dev libunbound-dev libtalloc-dev libwbclient-dev libykclient-dev libyubikey-dev python-dev ruby ruby-dev snmp software-properties-common python-software-properties libssl-dev libtalloc-dev libkqueue-dev make packaging-dev libkrb5-dev libreadline-dev samba4-dev openssh-server mercurial
+FROM freeradius/debian7-source
 
-#
-#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
-#
-RUN echo "deb http://http.debian.net/debian wheezy-backports main" >> /etc/apt/sources.list
-RUN apt-get update && apt-get install -y gcc-4.9 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
+WORKDIR /usr/local/src/repositories/freeradius-server
+RUN git checkout v3.0.x
+RUN ./configure --prefix=/opt/freeradius
+RUN make -j2
+RUN make install
+WORKDIR /opt/freeradius/etc/raddb
+RUN sed -i -e 's/allow_vulnerable_openssl.*/allow_vulnerable_openssl = yes/' radiusd.conf
+WORKDIR certs
+RUN make
+WORKDIR /
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
+EXPOSE 1812/udp 1813/udp
+CMD ["/opt/freeradius/sbin/radiusd", "-X"]
 
-#
-#  This is necessary for the jenkins server to talk to the docker instance
-#
-ENV DISABLE_HOTSPOT_OS_VERSION_CHECK=ok
-
-RUN hg clone http://hg.openjdk.java.net/jdk8/jdk8 YourOpenJDK ;\
-    cd YourOpenJDK ;\
-    bash ./get_source.sh
-RUN apt-get install -y cpio zip openjdk-7-jdk libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev cups libcups2-dev
-RUN apt-get install -y libfreetype6-dev libasound2-dev 
-
-RUN cd YourOpenJDK && bash ./configure && make 
-RUN cd YourOpenJDK && make install
-
-RUN apt-get install -y sudo && echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
-RUN useradd -m jenkins
-RUN echo "jenkins:jenkins1" | chpasswd
-RUN mkdir /var/run/sshd
-# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
-RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
-EXPOSE 22
-CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-debian7/Dockerfile.jenkins b/scripts/docker/build-debian7/Dockerfile.jenkins
new file mode 100644 (file)
index 0000000..42fc5e3
--- /dev/null
@@ -0,0 +1,25 @@
+FROM freeradius/debian7-source
+
+#
+#  This is necessary for the jenkins server to talk to the docker instance
+#
+ENV DISABLE_HOTSPOT_OS_VERSION_CHECK=ok
+
+RUN hg clone http://hg.openjdk.java.net/jdk8/jdk8 YourOpenJDK ;\
+    cd YourOpenJDK ;\
+    bash ./get_source.sh
+RUN apt-get install -y cpio zip openjdk-7-jdk libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev cups libcups2-dev
+RUN apt-get install -y libfreetype6-dev libasound2-dev 
+
+RUN cd YourOpenJDK && bash ./configure && make 
+RUN cd YourOpenJDK && make install
+
+RUN apt-get install -y sudo && echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
+RUN useradd -m jenkins
+RUN echo "jenkins:jenkins1" | chpasswd
+RUN mkdir /var/run/sshd
+# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-debian7/Dockerfile.source b/scripts/docker/build-debian7/Dockerfile.source
new file mode 100644 (file)
index 0000000..c1b2f04
--- /dev/null
@@ -0,0 +1,34 @@
+FROM debian:wheezy
+
+RUN apt-get update && apt-get install -y sudo firebird-dev freetds-dev libcap-dev libcollectdclient-dev libcurl4-openssl-dev libgdbm-dev libhiredis-dev libidn11-dev libiodbc2-dev libjson0-dev libldap2-dev libpq-dev libmemcached-dev libmysqlclient-dev libpam0g-dev libpcap-dev libperl-dev libsqlite3-dev libunbound-dev libtalloc-dev libwbclient-dev libykclient-dev libyubikey-dev python-dev ruby ruby-dev snmp software-properties-common python-software-properties libssl-dev libtalloc-dev libkqueue-dev make packaging-dev libkrb5-dev libreadline-dev samba4-dev openssh-server mercurial
+
+#
+#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
+#
+#  (This doesn't work, so for now wheezy is limited to FreeRADIUS
+#  v3 only, which isn't really much of a concern.)
+#
+# RUN echo "deb http://http.debian.net/debian wheezy-backports main" >> /etc/apt/sources.list
+# RUN apt-get update && apt-get install -y gcc-4.9 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
+
+#
+#  Install eapol_test dependencies
+#
+RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+#
+#  Setup a src dir in /usr/local
+#
+WORKDIR /usr/local/src/repositories
+RUN git clone --depth=1 --no-single-branch https://github.com/FreeRADIUS/freeradius-server.git
+WORKDIR freeradius-server
+
+# 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-3]*\.[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; \
+       done
+
index 74ec2e1fb0d3d05365b377c95a42f4697d9f8dfc..336a0c8f0892c6ac3240d3e8af97d7429236a33e 100644 (file)
@@ -1,48 +1,15 @@
-FROM debian:jessie
-RUN apt-get update && apt-get install -y devscripts equivs git quilt
+FROM freeradius/debian8-source
 
-#
-#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
-#
-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
+WORKDIR /usr/local/src/repositories/freeradius-server
+RUN ./configure --prefix=/opt/freeradius
+RUN make -j2
+RUN make install
+WORKDIR /opt/freeradius/etc/raddb
+RUN sed -i -e 's/allow_vulnerable_openssl.*/allow_vulnerable_openssl = yes/' radiusd.conf
+WORKDIR certs
+RUN make
+WORKDIR /
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
+EXPOSE 1812/udp 1813/udp
+CMD ["/opt/freeradius/sbin/radiusd", "-X"]
 
-#
-#  Setup a src dir in /usr/local
-#
-WORKDIR /usr/local/src/repositories
-RUN git clone --depth=1 https://github.com/FreeRADIUS/freeradius-server.git
-WORKDIR freeradius-server
-
-# 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; \
-       done
-
-### For some reason this dep was not installed
-# RUN apt-get install -y libiodbc2-dev
-
-#
-#  This is necessary for the jenkins server to talk to the docker instance
-#
-RUN echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list
-RUN apt-get update && apt-get -t jessie-backports install -y openjdk-8-jre-headless 
-RUN apt-get install -y openssh-server sudo 
-
-RUN useradd -m jenkins
-RUN echo "jenkins:jenkins1" | chpasswd
-RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
-
-RUN mkdir /var/run/sshd
-# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
-RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
-
-EXPOSE 22
-CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-debian8/Dockerfile.jenkins b/scripts/docker/build-debian8/Dockerfile.jenkins
new file mode 100644 (file)
index 0000000..9fc0969
--- /dev/null
@@ -0,0 +1,19 @@
+FROM freeradius/debian8-source
+
+#
+#  This is necessary for the jenkins server to talk to the docker instance
+#
+RUN echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list
+RUN apt-get update && apt-get -t jessie-backports install -y openjdk-8-jre-headless 
+RUN apt-get install -y openssh-server sudo 
+
+RUN useradd -m jenkins
+RUN echo "jenkins:jenkins1" | chpasswd
+RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
+
+RUN mkdir /var/run/sshd
+# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-debian8/Dockerfile.source b/scripts/docker/build-debian8/Dockerfile.source
new file mode 100644 (file)
index 0000000..22717df
--- /dev/null
@@ -0,0 +1,32 @@
+FROM debian:jessie
+
+RUN apt-get update && apt-get install -y devscripts equivs git quilt
+
+#
+#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
+#
+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
+
+#
+#  Install eapol_test dependencies
+#
+RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+#
+#  Setup a src dir in /usr/local
+#
+WORKDIR /usr/local/src/repositories
+RUN git clone --depth=1 --no-single-branch https://github.com/FreeRADIUS/freeradius-server.git
+WORKDIR freeradius-server
+
+# 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; \
+       done
+
+### For some reason this dep was not installed
+# RUN apt-get install -y libiodbc2-dev
+
index 5735a7c523958541fe952b15e6fa58849eae78c4..dc4d612b2aa0d6e7964c0ef7e9b869e1526ea0ed 100644 (file)
@@ -1,71 +1,15 @@
-FROM debian:stretch
-RUN apt-get update && apt-get install -y devscripts equivs git quilt
+FROM freeradius/debian9-source
 
-#
-#  Stretch uses gcc4.9 by default, so we don't need to install any additional compilers to get C11 functionality
-#
+WORKDIR /usr/local/src/repositories/freeradius-server
+RUN ./configure --prefix=/opt/freeradius
+RUN make -j2
+RUN make install
+WORKDIR /opt/freeradius/etc/raddb
+RUN sed -i -e 's/allow_vulnerable_openssl.*/allow_vulnerable_openssl = yes/' radiusd.conf
+WORKDIR certs
+RUN make
+WORKDIR /
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
+EXPOSE 1812/udp 1813/udp
+CMD ["/opt/freeradius/sbin/radiusd", "-X"]
 
-#
-#  Setup a src dir in /usr/local
-#
-RUN mkdir -p /usr/local/src/repositories
-WORKDIR /usr/local/src
-
-#
-#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
-#
-RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
-RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
-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 patch-3 --depth=1 https://github.com/arr2036/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
-
-#
-#  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
-#
-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; \
-       done
-
-#
-#  This is necessary for the jenkins server to talk to the docker instance
-#
-RUN echo deb http://ftp.debian.org/debian stretch-backports main >> /etc/apt/sources.list
-RUN apt-get update && apt-get -t stretch-backports install -y openjdk-8-jre-headless 
-RUN apt-get install -y openssh-server sudo 
-
-RUN useradd -m jenkins
-RUN echo "jenkins:jenkins1" | chpasswd
-RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
-RUN mkdir /var/run/sshd
-
-# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
-RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
-
-EXPOSE 22
-CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-debian9/Dockerfile.jenkins b/scripts/docker/build-debian9/Dockerfile.jenkins
new file mode 100644 (file)
index 0000000..af3c7a7
--- /dev/null
@@ -0,0 +1,19 @@
+FROM freeradius/debian9-source
+
+#
+#  This is necessary for the jenkins server to talk to the docker instance
+#
+RUN echo deb http://ftp.debian.org/debian stretch-backports main >> /etc/apt/sources.list
+RUN apt-get update && apt-get -t stretch-backports install -y openjdk-8-jre-headless 
+RUN apt-get install -y openssh-server sudo 
+
+RUN useradd -m jenkins
+RUN echo "jenkins:jenkins1" | chpasswd
+RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
+RUN mkdir /var/run/sshd
+
+# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-debian9/Dockerfile.source b/scripts/docker/build-debian9/Dockerfile.source
new file mode 100644 (file)
index 0000000..3c4bb0e
--- /dev/null
@@ -0,0 +1,55 @@
+FROM debian:stretch
+
+RUN apt-get update && apt-get install -y devscripts equivs git quilt
+
+#
+#  Stretch uses gcc4.9 by default, so we don't need to install any additional compilers to get C11 functionality
+#
+
+#
+#  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
+
+#
+#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
+#
+RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
+RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
+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 patch-3 --depth=1 https://github.com/arr2036/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
+
+#
+#  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
+#
+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; \
+       done
+
diff --git a/scripts/docker/build-debian9/README b/scripts/docker/build-debian9/README
new file mode 100644 (file)
index 0000000..f7a6135
--- /dev/null
@@ -0,0 +1,15 @@
+
+Build source image
+
+    docker build . -f Dockerfile.source -t freeradius:debian9-source
+
+Then either build and run jenkins image
+
+    docker build . -f Dockerfile.jenkins -t freeradius:debian9-jenkins
+    docker run -d -p 2222:22 freeradius:debian9-jenkins
+
+or build and run the server
+
+    docker build . -t freeradius:debian9
+    docker run -d -p 1812:1812/udp -p 1813:1813/udp freeradius:debian9
+
index 6daf8a98dfef8a6d2a279842c43f244537d2cc8f..d03511554a64a0f1e813699a84323fbbc78cfeeb 100644 (file)
@@ -1,79 +1,15 @@
-FROM ubuntu:14.04
-RUN apt-get update && apt-get install -y devscripts equivs git quilt
+FROM freeradius/ubuntu14-source
 
-#
-#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
-#
-RUN apt-get install -y software-properties-common python-software-properties
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test
-RUN apt-get update
-RUN apt-get install -y g++-4.9 llvm-3.9 clang-3.9 lldb-3.9
+WORKDIR /usr/local/src/repositories/freeradius-server
+RUN ./configure --prefix=/opt/freeradius
+RUN make -j2
+RUN make install
+WORKDIR /opt/freeradius/etc/raddb
+RUN sed -i -e 's/allow_vulnerable_openssl.*/allow_vulnerable_openssl = yes/' radiusd.conf
+WORKDIR certs
+RUN make
+WORKDIR /
 
-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 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-3.9 60 && update-alternatives --config lldb
+EXPOSE 1812/udp 1813/udp
+CMD ["/opt/freeradius/sbin/radiusd", "-X"]
 
-#
-#  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
-
-#
-#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
-#
-RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
-RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
-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 patch-3 --depth=1 https://github.com/arr2036/libkqueue.git
-WORKDIR libkqueue
-RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
-    make && \
-    cpack -G DEB
-RUN dpkg -i --force-all ./libkqueue-*deb
-WORKDIR /usr/local/src/repositories
-
-#
-#  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
-#
-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; \
-               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
-
-#
-#  This is necessary for the jenkins server to talk to the docker instance
-#
-#RUN echo deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse >>  /etc/apt/sources.list
-RUN apt-add-repository ppa:openjdk-r/ppa
-RUN apt-get update && apt-get install -y openjdk-8-jre-headless
-RUN apt-get install -y openssh-server
-RUN useradd -m jenkins
-RUN echo "jenkins:jenkins1" | chpasswd
-RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
-RUN mkdir /var/run/sshd
-# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
-RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
-EXPOSE 22
-CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-ubuntu14/Dockerfile.jenkins b/scripts/docker/build-ubuntu14/Dockerfile.jenkins
new file mode 100644 (file)
index 0000000..6c45c2a
--- /dev/null
@@ -0,0 +1,18 @@
+FROM freeradius/ubuntu14-source
+
+#
+#  This is necessary for the jenkins server to talk to the docker instance
+#
+#RUN echo deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse >>  /etc/apt/sources.list
+RUN apt-add-repository ppa:openjdk-r/ppa
+RUN apt-get update && apt-get install -y openjdk-8-jre-headless
+RUN apt-get install -y openssh-server
+RUN useradd -m jenkins
+RUN echo "jenkins:jenkins1" | chpasswd
+RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
+RUN mkdir /var/run/sshd
+# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-ubuntu14/Dockerfile.source b/scripts/docker/build-ubuntu14/Dockerfile.source
new file mode 100644 (file)
index 0000000..864b460
--- /dev/null
@@ -0,0 +1,63 @@
+FROM ubuntu:14.04
+
+RUN apt-get update && apt-get install -y devscripts equivs git quilt
+
+#
+#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
+#
+RUN apt-get install -y software-properties-common python-software-properties
+RUN add-apt-repository ppa:ubuntu-toolchain-r/test
+RUN apt-get update
+RUN apt-get install -y g++-4.9 llvm-3.9 clang-3.9 lldb-3.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 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 60 && update-alternatives --config clang
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-3.9 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
+
+#
+#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
+#
+RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
+RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
+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 patch-3 --depth=1 https://github.com/arr2036/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
+WORKDIR /usr/local/src/repositories
+
+#
+#  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
+#
+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; \
+               if [ -e ./debian/control.in ] ; then debian/rules debian/control ; fi ; echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control ; \
+       done
+
index 9e5286c0008bdeba788d08912e502216f1599dc3..cdfd27493d8e2f04782f3087a5f60b5825d472da 100644 (file)
@@ -1,79 +1,15 @@
-FROM ubuntu:16.04
-RUN apt-get update && apt-get install -y devscripts equivs git quilt
+FROM freeradius/ubuntu16-source
 
-#
-#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
-#
-RUN apt-get install -y software-properties-common python-software-properties
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test
-RUN apt-get update
-RUN apt-get install -y g++-4.9 llvm-3.9 clang-3.9 lldb-3.9
+WORKDIR /usr/local/src/repositories/freeradius-server
+RUN ./configure --prefix=/opt/freeradius
+RUN make -j2
+RUN make install
+WORKDIR /opt/freeradius/etc/raddb
+RUN sed -i -e 's/allow_vulnerable_openssl.*/allow_vulnerable_openssl = yes/' radiusd.conf
+WORKDIR certs
+RUN make
+WORKDIR /
 
-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 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-3.9 60 && update-alternatives --config lldb
+EXPOSE 1812/udp 1813/udp
+CMD ["/opt/freeradius/sbin/radiusd", "-X"]
 
-#
-#  Install eapol_test dependencies
-#
-RUN apt-get -y install 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
-
-#
-#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
-#
-RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
-RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
-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 patch-3 --depth=1 https://github.com/arr2036/libkqueue.git
-WORKDIR libkqueue
-RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
-    make && \
-    cpack -G DEB
-RUN dpkg -i --force-all ./libkqueue-*deb
-WORKDIR /usr/local/src/repositories
-
-#
-#  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
-#
-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; \
-               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
-
-#
-#  This is necessary for the jenkins server to talk to the docker instance
-#
-#RUN echo deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse >>  /etc/apt/sources.list
-RUN apt-add-repository ppa:openjdk-r/ppa
-RUN apt-get update && apt-get install -y openjdk-8-jre-headless
-RUN apt-get install -y openssh-server
-RUN useradd -m jenkins
-RUN echo "jenkins:jenkins1" | chpasswd
-RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
-RUN mkdir /var/run/sshd
-# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
-RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
-EXPOSE 22
-CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-ubuntu16/Dockerfile.jenkins b/scripts/docker/build-ubuntu16/Dockerfile.jenkins
new file mode 100644 (file)
index 0000000..91c6e66
--- /dev/null
@@ -0,0 +1,18 @@
+FROM freeradius/ubuntu16-source
+
+#
+#  This is necessary for the jenkins server to talk to the docker instance
+#
+#RUN echo deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse >>  /etc/apt/sources.list
+RUN apt-add-repository ppa:openjdk-r/ppa
+RUN apt-get update && apt-get install -y openjdk-8-jre-headless
+RUN apt-get install -y openssh-server
+RUN useradd -m jenkins
+RUN echo "jenkins:jenkins1" | chpasswd
+RUN echo "jenkins ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
+RUN mkdir /var/run/sshd
+# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd","-D"]
diff --git a/scripts/docker/build-ubuntu16/Dockerfile.source b/scripts/docker/build-ubuntu16/Dockerfile.source
new file mode 100644 (file)
index 0000000..8656889
--- /dev/null
@@ -0,0 +1,63 @@
+FROM ubuntu:16.04
+
+RUN apt-get update && apt-get install -y devscripts equivs git quilt
+
+#
+#  Install GCC-4.9 as it has the requisite support for C11 keywords and atomics
+#
+RUN apt-get install -y software-properties-common python-software-properties
+RUN add-apt-repository ppa:ubuntu-toolchain-r/test
+RUN apt-get update
+RUN apt-get install -y g++-4.9 llvm-3.9 clang-3.9 lldb-3.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 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 60 && update-alternatives --config clang
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-3.9 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
+#
+RUN mkdir -p /usr/local/src/repositories
+WORKDIR /usr/local/src/repositories
+
+#
+#  Get a modern version of cmake.  We need 3.8.2 or later to build libkqueue rpms
+#
+RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
+RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ]
+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 patch-3 --depth=1 https://github.com/arr2036/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
+WORKDIR /usr/local/src/repositories
+
+#
+#  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
+#
+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; \
+               if [ -e ./debian/control.in ] ; then debian/rules debian/control ; fi ; echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control ; \
+       done
+
diff --git a/scripts/docker/dockerbuild b/scripts/docker/dockerbuild
new file mode 100755 (executable)
index 0000000..168499d
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+DIR="$1"
+
+[ -z "$DIR" ] && echo "Syntax: $0 <dir>" && exit 1
+[ ! -d "$DIR" ] && echo "Directory '$DIR' does not exist" && exit 1
+
+OSNAME=$(echo "$DIR" | sed -e 's/^build-//')
+
+[ ! -r "$DIR/Dockerfile.source" ] && echo "'$DIR/Dockerfile.source' does not exist" && exit 1
+echo Building $OSNAME source image
+docker build "$DIR" -f "$DIR/Dockerfile.source" -t freeradius/$OSNAME-source
+
+if [ -r "$DIR/Dockerfile.jenkins" ]; then
+       echo Building $OSNAME jenkins image
+       docker build "$DIR" -f "$DIR/Dockerfile.jenkins" -t freeradius/$OSNAME-jenkins
+fi
+
+if [ -r "$DIR/Dockerfile" ]; then
+       echo Building $OSNAME FreeRADIUS image
+       docker build "$DIR" -t freeradius/$OSNAME
+fi
+