summaryrefslogtreecommitdiffstats
path: root/scripts/docker/dists/debian11
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:41:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:41:53 +0000
commit1526b335a5a81d945e64291e2fbcf92f72d15a4e (patch)
tree64d3bc5d36df06664cc49d7c4d8710100e23b888 /scripts/docker/dists/debian11
parentReleasing progress-linux version 3.2.3+dfsg-2~progress7.99u1. (diff)
downloadfreeradius-1526b335a5a81d945e64291e2fbcf92f72d15a4e.tar.xz
freeradius-1526b335a5a81d945e64291e2fbcf92f72d15a4e.zip
Merging upstream version 3.2.5+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/docker/dists/debian11')
-rw-r--r--scripts/docker/dists/debian11/Dockerfile87
-rwxr-xr-xscripts/docker/dists/debian11/docker-entrypoint.sh24
2 files changed, 111 insertions, 0 deletions
diff --git a/scripts/docker/dists/debian11/Dockerfile b/scripts/docker/dists/debian11/Dockerfile
new file mode 100644
index 0000000..f709d95
--- /dev/null
+++ b/scripts/docker/dists/debian11/Dockerfile
@@ -0,0 +1,87 @@
+# Auto generated for debian11
+# from scripts/docker/m4/Dockerfile.deb.m4
+#
+# Rebuild this file with `make docker.debian11.regen`
+#
+ARG from=debian:bullseye
+FROM ${from} as build
+
+ARG DEBIAN_FRONTEND=noninteractive
+
+#
+# Install build tools
+#
+RUN apt-get update
+RUN apt-get install -y devscripts equivs git quilt gcc
+
+#
+# Create build directory
+#
+RUN mkdir -p /usr/local/src/repositories/freeradius-server
+WORKDIR /usr/local/src/repositories/freeradius-server/
+
+#
+# Copy the FreeRADIUS directory in
+#
+COPY . .
+
+#
+# Clean up tree - we want to build from the latest commit, not from
+# any cruft left around on the local system
+#
+RUN git clean -fdxx \
+ && git reset --hard HEAD
+
+ARG release
+RUN [ -z "$release" ] || git checkout ${release} ; \
+ git status ; \
+ git log -1 --oneline
+
+#
+# Install build dependencies
+#
+RUN 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
+#
+# Work around fakeroot problems in Docker when building for different
+# platforms - doesn't matter as we run as root in the container anyway.
+#
+#RUN make -j$(nproc) deb
+RUN debian/rules debian/control \
+ && dpkg-buildpackage --jobs=auto -b -uc
+
+#
+# Clean environment and run the server
+#
+FROM ${from}
+ARG DEBIAN_FRONTEND=noninteractive
+
+COPY --from=build /usr/local/src/repositories/*.deb /tmp/
+
+RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
+
+ARG freerad_uid=101
+ARG freerad_gid=101
+
+RUN groupadd -g ${freerad_gid} -r freerad \
+ && useradd -u ${freerad_uid} -g freerad -r -M -d /etc/freeradius -s /usr/sbin/nologin freerad \
+ && apt-get update \
+ && apt-get install -y tzdata \
+ && apt-get install -y /tmp/*.deb \
+ && apt-get clean \
+ && rm -r /var/lib/apt/lists/* /tmp/*.deb \
+ \
+ && ln -s /etc/freeradius /etc/raddb
+
+WORKDIR /
+COPY scripts/docker/etc/docker-entrypoint.sh.deb docker-entrypoint.sh
+RUN chmod +x docker-entrypoint.sh
+
+EXPOSE 1812/udp 1813/udp
+ENTRYPOINT ["/docker-entrypoint.sh"]
+CMD ["freeradius"]
diff --git a/scripts/docker/dists/debian11/docker-entrypoint.sh b/scripts/docker/dists/debian11/docker-entrypoint.sh
new file mode 100755
index 0000000..93141b0
--- /dev/null
+++ b/scripts/docker/dists/debian11/docker-entrypoint.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+# this if will check if the first argument is a flag
+# but only works if all arguments require a hyphenated flag
+# -v; -SL; -f arg; etc will work, but not arg1 arg2
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+ set -- freeradius "$@"
+fi
+
+# check for the expected command
+if [ "$1" = 'freeradius' ]; then
+ shift
+ exec freeradius -f "$@"
+fi
+
+# many people are likely to call "radiusd" as well, so allow that
+if [ "$1" = 'radiusd' ]; then
+ shift
+ exec freeradius -f "$@"
+fi
+
+# else default to run whatever the user wanted like "bash" or "sh"
+exec "$@"