|
| 1 | +# Auto generated for ubuntu26 |
| 2 | +# from scripts/docker/m4/Dockerfile.deb.m4 |
| 3 | +# |
| 4 | +# Rebuild this file with `make docker.ubuntu26.regen` |
| 5 | +# |
| 6 | +ARG from=ubuntu:26.04 |
| 7 | +FROM ${from} AS build |
| 8 | + |
| 9 | +ARG DEBIAN_FRONTEND=noninteractive |
| 10 | + |
| 11 | +# |
| 12 | +# Install build tools |
| 13 | +# |
| 14 | +RUN apt-get update |
| 15 | +RUN apt-get install -y devscripts equivs git quilt gcc |
| 16 | + |
| 17 | +# |
| 18 | +# Create build directory |
| 19 | +# |
| 20 | +RUN mkdir -p /usr/local/src/repositories/freeradius-server |
| 21 | +WORKDIR /usr/local/src/repositories/freeradius-server/ |
| 22 | + |
| 23 | +# |
| 24 | +# Copy the FreeRADIUS directory in |
| 25 | +# |
| 26 | +COPY . . |
| 27 | + |
| 28 | +# |
| 29 | +# Clean up tree - we want to build from the latest commit, not from |
| 30 | +# any cruft left around on the local system |
| 31 | +# |
| 32 | +RUN git clean -fdxx \ |
| 33 | + && git reset --hard HEAD |
| 34 | + |
| 35 | +ARG release |
| 36 | +RUN [ -z "$release" ] || git checkout ${release} ; \ |
| 37 | + git status ; \ |
| 38 | + git log -1 --oneline |
| 39 | + |
| 40 | +# |
| 41 | +# Install build dependencies |
| 42 | +# |
| 43 | +RUN if [ -e ./debian/control.in ]; then \ |
| 44 | + debian/rules debian/control; \ |
| 45 | + fi; \ |
| 46 | + echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control |
| 47 | + |
| 48 | +# |
| 49 | +# Build the server |
| 50 | +# |
| 51 | +# Work around fakeroot problems in Docker when building for different |
| 52 | +# platforms - doesn't matter as we run as root in the container anyway. |
| 53 | +# |
| 54 | +#RUN make -j$(nproc) deb |
| 55 | +RUN debian/rules debian/control \ |
| 56 | + && dpkg-buildpackage --jobs=auto -b -uc |
| 57 | + |
| 58 | +# |
| 59 | +# Clean environment and run the server |
| 60 | +# |
| 61 | +FROM ${from} |
| 62 | +ARG DEBIAN_FRONTEND=noninteractive |
| 63 | + |
| 64 | +COPY --from=build /usr/local/src/repositories/*.deb /tmp/ |
| 65 | + |
| 66 | +RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime |
| 67 | + |
| 68 | +ARG freerad_uid=101 |
| 69 | +ARG freerad_gid=101 |
| 70 | + |
| 71 | +RUN groupadd -g ${freerad_gid} -r freerad \ |
| 72 | + && useradd -u ${freerad_uid} -g freerad -r -M -d /etc/freeradius -s /usr/sbin/nologin freerad \ |
| 73 | + && apt-get update \ |
| 74 | + && apt-get install -y tzdata \ |
| 75 | + && apt-get install -y /tmp/*.deb \ |
| 76 | + && apt-get clean \ |
| 77 | + && rm -r /var/lib/apt/lists/* /tmp/*.deb \ |
| 78 | + \ |
| 79 | + && ln -s /etc/freeradius /etc/raddb |
| 80 | + |
| 81 | +WORKDIR / |
| 82 | +COPY scripts/docker/etc/docker-entrypoint.sh.deb docker-entrypoint.sh |
| 83 | +RUN chmod +x docker-entrypoint.sh |
| 84 | + |
| 85 | +EXPOSE 1812/udp 1813/udp |
| 86 | +ENTRYPOINT ["/docker-entrypoint.sh"] |
| 87 | +CMD ["freeradius"] |
0 commit comments