Skip to content

Commit

Permalink
added docker scripts for ubuntu bionic
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Rose committed Nov 5, 2018
1 parent 40c7138 commit 732403f
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/docker/build-ubuntu18/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG from=freeradius/ubuntu18-deps
FROM ${from}

ARG cc=gcc

WORKDIR /usr/local/src/repositories/freeradius-server
RUN CC=${cc} ./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 /

FROM ${from}
COPY --from=0 /opt/freeradius /opt/freeradius

EXPOSE 1812/udp 1813/udp
CMD ["/opt/freeradius/sbin/radiusd", "-X"]

66 changes: 66 additions & 0 deletions scripts/docker/build-ubuntu18/Dockerfile.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM ubuntu:18.04

ARG gccver=4.9
ARG clangver=5.0
ARG osname=bionic

#
# Install add-apt-repository
#
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-get clean && \
rm -r /var/lib/apt/lists/*

RUN apt-get update && \
# Development utilities
apt-get install -y devscripts equivs git quilt && \
# Compilers
apt-get install -y g++ llvm clang lldb && \
# eapol_test dependencies
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
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 && \
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

23 changes: 23 additions & 0 deletions scripts/docker/build-ubuntu18/Dockerfile.jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG from=freeradius/ubuntu18-deps
FROM ${from}

ARG osname=xenial

#
# This is necessary for the jenkins server to talk to the docker instance
#
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 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"]

0 comments on commit 732403f

Please sign in to comment.