From: Matthew Newton Date: Sat, 14 Aug 2021 20:47:06 +0000 (+0100) Subject: add Debian 11 Bullseye Dockerfile and to CI X-Git-Tag: release_3_0_24~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ed0323d72e307cbc03bdd47eb77458d8ed42b0f;p=thirdparty%2Ffreeradius-server.git add Debian 11 Bullseye Dockerfile and to CI --- diff --git a/.github/workflows/ci-deb.yml b/.github/workflows/ci-deb.yml index 87ad3ec3540..69bf560bfda 100644 --- a/.github/workflows/ci-deb.yml +++ b/.github/workflows/ci-deb.yml @@ -20,6 +20,7 @@ jobs: - { NAME: "ubuntu-20.04", OS: "ubuntu:20.04" } - { NAME: "debian-9", OS: "debian:stretch" } - { NAME: "debian-10", OS: "debian:buster" } + - { NAME: "debian-11", OS: "debian:bullseye" } - { NAME: "debian-sid", OS: "debian:sid" } fail-fast: false @@ -117,6 +118,7 @@ jobs: - { NAME: "ubuntu-20.04", OS: "ubuntu:20.04" } - { NAME: "debian-9", OS: "debian:stretch" } - { NAME: "debian-10", OS: "debian:buster" } + - { NAME: "debian-11", OS: "debian:bullseye" } - { NAME: "debian-sid", OS: "debian:sid" } fail-fast: false diff --git a/scripts/docker/debian11/Dockerfile b/scripts/docker/debian11/Dockerfile new file mode 100644 index 00000000000..18e76f25626 --- /dev/null +++ b/scripts/docker/debian11/Dockerfile @@ -0,0 +1,58 @@ +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 +WORKDIR /usr/local/src/repositories + +# +# Shallow clone the FreeRADIUS source +# +ARG source=https://github.com/FreeRADIUS/freeradius-server.git +ARG release=v3.0.x + +RUN git clone --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 + +# +# Clean environment and run the server +# +FROM ${from} +COPY --from=build /usr/local/src/repositories/*.deb /tmp/ + +RUN apt-get update \ + && apt-get install -y /tmp/*.deb \ + && apt-get clean \ + && rm -r /var/lib/apt/lists/* /tmp/*.deb \ + \ + && ln -s /etc/freeradius /etc/raddb + +COPY docker-entrypoint.sh / + +EXPOSE 1812/udp 1813/udp +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["freeradius"] diff --git a/scripts/docker/debian11/docker-entrypoint.sh b/scripts/docker/debian11/docker-entrypoint.sh new file mode 100755 index 00000000000..93141b0d74b --- /dev/null +++ b/scripts/docker/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 "$@"