Skip to content

Commit

Permalink
Fix/8300 Remove radiusd from building in docker and use the one on re…
Browse files Browse the repository at this point in the history
…pos (#8305)

* Clean container/radiusd dockerfile to keep essential and install from repo

* Move radiusd to previous stage and change ci dependencies

* Update radius version to install

* CI wake up
  • Loading branch information
JeGoi authored Sep 24, 2024
1 parent 85586b3 commit dddc7f9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 64 deletions.
64 changes: 56 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ pfdeb_based_dev:
- "httpd.aaa"
- "httpd.admin_dispatcher"
- "httpd.webservices"
- "radiusd"
- "pfsetacls"
- "pfsso"
- "pfperl-api"
Expand Down Expand Up @@ -661,7 +660,20 @@ rad_based_dev:
extends:
- .build_img_container_job_dev
- .build_img_container_devel_rules
needs: ["pfdeb_based_dev"]
needs: ["pfdeb_dev"]
variables:
IMAGE_TAGS: "${CI_COMMIT_REF_SLUG},latest"
parallel:
# /!\ Be sure to update this list in all other matrix /!\
matrix:
- IMAGE_NAME:
- "radiusd"

rad_extend_dev:
extends:
- .build_img_container_job_dev
- .build_img_container_devel_rules
needs: ["rad_based_dev"]
variables:
IMAGE_TAGS: "${CI_COMMIT_REF_SLUG},latest"
parallel:
Expand Down Expand Up @@ -713,7 +725,6 @@ pfdeb_based_br_maint:
- "httpd.aaa"
- "httpd.admin_dispatcher"
- "httpd.webservices"
- "radiusd"
- "pfsetacls"
- "pfsso"
- "pfperl-api"
Expand Down Expand Up @@ -744,7 +755,20 @@ rad_based_br_maint:
extends:
- .build_img_container_job_br_maint
- .build_img_container_branches_and_maintenance_rules
needs: ["pfdeb_based_br_maint"]
needs: ["pfdeb_br_maint"]
variables:
IMAGE_TAGS: ${CI_COMMIT_REF_SLUG}
parallel:
# /!\ Be sure to update this list in all other matrix /!\
matrix:
- IMAGE_NAME:
- "radiusd"

rad_extend_br_maint:
extends:
- .build_img_container_job_br_maint
- .build_img_container_branches_and_maintenance_rules
needs: ["rad_based_br_maint"]
variables:
IMAGE_TAGS: ${CI_COMMIT_REF_SLUG}
parallel:
Expand Down Expand Up @@ -796,7 +820,6 @@ pfdeb_based_cloud_nac:
- "httpd.aaa"
- "httpd.admin_dispatcher"
- "httpd.webservices"
- "radiusd"
- "pfsetacls"
- "pfsso"
- "pfperl-api"
Expand Down Expand Up @@ -827,7 +850,20 @@ rad_based_cloud_nac:
extends:
- .build_img_container_job_cloud_nac
- .build_img_container_cloud_nac_rules
needs: ["pfdeb_based_cloud_nac"]
needs: ["pfdeb_cloud_nac"]
variables:
IMAGE_TAGS: ${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}
parallel:
# /!\ Be sure to update this list in all other matrix /!\
matrix:
- IMAGE_NAME:
- "radiusd"

rad_extend_cloud_nac:
extends:
- .build_img_container_job_cloud_nac
- .build_img_container_cloud_nac_rules
needs: ["rad_based_cloud_nac"]
variables:
IMAGE_TAGS: ${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}
parallel:
Expand Down Expand Up @@ -879,7 +915,6 @@ pfdeb_based_rel:
- "httpd.aaa"
- "httpd.admin_dispatcher"
- "httpd.webservices"
- "radiusd"
- "pfsetacls"
- "pfsso"
- "pfperl-api"
Expand Down Expand Up @@ -910,7 +945,20 @@ rad_based_rel:
extends:
- .build_img_container_job_rel
- .release_only_rules
needs: ["pfdeb_based_rel"]
needs: ["pfdeb_rel"]
variables:
IMAGE_TAGS: ${CI_COMMIT_TAG}
parallel:
# /!\ Be sure to update this list in all other matrix /!\
matrix:
- IMAGE_NAME:
- "radiusd"

rad_extend_rel:
extends:
- .build_img_container_job_rel
- .release_only_rules
needs: ["rad_based_rel"]
variables:
IMAGE_TAGS: ${CI_COMMIT_TAG}
parallel:
Expand Down
58 changes: 2 additions & 56 deletions containers/radiusd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,65 +1,11 @@
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.6

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 /tmp/*.deb \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/* /tmp/*.deb \
\
&& ln -s /etc/freeradius /etc/raddb
&& apt-get -qq install -y freeradius=3:3.2.6+git \
&& apt-get clean

WORKDIR /usr/local/pf/

Expand Down

0 comments on commit dddc7f9

Please sign in to comment.