Skip to content

Commit

Permalink
Build radius docker image from the FreeRADIUS sources
Browse files Browse the repository at this point in the history
  • Loading branch information
fdurand committed Mar 3, 2025
1 parent 06ae12b commit 7d4ddb6
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions containers/radiusd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,65 @@
ARG from=debian:bookworm
ARG KNK_REGISTRY_URL
ARG IMAGE_TAG

FROM ${from} as build

ARG DEBIAN_FRONTEND=noninteractive

#
# Install build tools
#
RUN apt-get -qq update
RUN apt-get -qq install -y devscripts equivs git quilt gcc libcollectdclient-dev

#
# Create build directory
#
RUN mkdir -p /usr/local/src/repositories
WORKDIR /usr/local/src/repositories

#
# Shallow clone the FreeRADIUS source
#
ARG source=https://github.com/inverse-inc/freeradius-server.git
ARG release=feature/PacketFence_3.2.7

RUN git clone -qq --depth 1 --single-branch --branch ${release} ${source}
WORKDIR freeradius-server

#
# Install build dependencies
#
RUN git checkout ${release}; \
if [ -e ./debian/control.in ]; then \
debian/rules debian/control; \
fi; \
echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control

#
# Build the server
#
# RUN make -j2 deb >/dev/null || make -j2 deb
RUN make -j2 deb

#
# Clean environment and run the server
#
FROM ${KNK_REGISTRY_URL}/pfdebian:${IMAGE_TAG}

# Copy debian packages
COPY --from=build /usr/local/src/repositories/*.deb /tmp/

RUN apt-get -qq -y remove freeradius-common


RUN apt-get -qq update \
&& apt-get clean \
&& apt-get -qq install -y freeradius=3:3.2.6+git freeradius-common=3:3.2.6+git freeradius-config=3:3.2.6+git freeradius-ldap=3:3.2.6+git freeradius-mysql=3:3.2.6+git freeradius-redis=3:3.2.6+git freeradius-rest=3:3.2.6+git freeradius-utils=3:3.2.6+git \
&& apt-get clean
&& apt-get -qq install -y /tmp/*.deb \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/* /tmp/*.deb \
\
&& ln -s /etc/freeradius /etc/raddb

WORKDIR /usr/local/pf/

Expand Down

0 comments on commit 7d4ddb6

Please sign in to comment.