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
+RUN apt-get install -y g++-4.9 llvm-3.9 clang-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
-WORKDIR /usr/local/src/repositories
-RUN git clone --depth=1 --no-single-branch https://github.com/mattrose/freeradius-server.git
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 60 && update-alternatives --config clang
+#
+# Shallow clone the FreeRADIUS source
+#
+RUN mkdir -p /usr/local/src/repositories
+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
-# RUN if [ -e ./debian/control.in ] ; then debian/rules debian/control ; fi ; echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control
-# 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; \
done
### For some reason this dep was not installed
-### This is necessary for the jenkins server to talk to the docker instance
+
+#
+# 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