Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Provide containers for packaging #7789

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions containers/packaging/deb11/FreeRadius/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG from=debian:bullseye
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
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
4 changes: 4 additions & 0 deletions containers/packaging/deb11/FreeRadius/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## How to use:
Build the image
Run/Jump the container
scp all .deb file from the container /tmp
106 changes: 106 additions & 0 deletions containers/packaging/el8/FreeRadius/Dokerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
ARG from=rockylinux/rockylinux:8
FROM ${from} as build

RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

#
# Install build tools
#
RUN yum groupinstall -y "Development Tools"
RUN yum install -y rpmdevtools openssl dnf-utils

#
# 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.2

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

#
# Other requirements
#

# 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

# EPEL repository for freetds and hiredis
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# PacketFence REPO
RUN yum install -y http://packetfence.org/downloads/PacketFence/RHEL8/packetfence-release-11.2.el8.noarch.rpm

RUN yum config-manager --enable powertools
# Currently needed for hiredis-devel
RUN yum config-manager --enable epel-testing

RUN yum config-manager --enable packetfence
#
# Install build dependencies
#
RUN [ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec

#
# Create RPM build environment
#
ENV BUILDDIR=/root/rpmbuild
RUN rpmdev-setuptree

RUN ./configure
RUN make freeradius-server-$(cat VERSION).tar.bz2
RUN cp freeradius-server-$(cat VERSION).tar.bz2 $BUILDDIR/SOURCES/
RUN cp -r redhat/* $BUILDDIR/SOURCES/
RUN cp -r redhat/freeradius.spec $BUILDDIR/SPECS/
WORKDIR $BUILDDIR

#
# Build the server
#
ENV QA_RPATHS=0x0003
RUN rpmbuild -bb --define '_release $release' "$BUILDDIR/SPECS/freeradius.spec"

RUN mkdir /root/rpms
RUN mv $BUILDDIR/RPMS/*/*.rpm /root/rpms/

#
# Clean environment and run the server
#
FROM ${from}
COPY --from=build /root/rpms /tmp/

# 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 \
&& rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project \
\
# EPEL repository for freetds and hiredis
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
&& yum install -y dnf-utils \
&& yum config-manager --enable epel-testing

RUN yum install -y /tmp/*.rpm

#COPY docker-entrypoint.sh /
#RUN chmod +x /docker-entrypoint.sh

#EXPOSE 1812/udp 1813/udp
#ENTRYPOINT ["/docker-entrypoint.sh"]
#CMD ["radiusd"]
4 changes: 4 additions & 0 deletions containers/packaging/el8/FreeRadius/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## How to use:
Build the image
Run/Jump the container
scp all .rpm file from the container /tmp