-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
84 lines (67 loc) · 2.21 KB
/
Copy pathDockerfile
File metadata and controls
84 lines (67 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
ARG from=debian:bookworm
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} AS base
COPY --from=build /usr/local/src/repositories/*.deb /tmp/
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 /tmp/*.deb \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/* /tmp/*.deb \
\
&& ln -s /etc/freeradius /etc/raddb
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["freeradius"]
FROM base AS production
LABEL org.opencontainers.image.source="https://github.com/odit.services/freeradius-sldap"
LABEL org.opencontainers.image.description="FreeRADIUS preconfigured to work with Google's secure ldap as the authentication backend"
LABEL org.opencontainers.image.licenses="GPL-2.0"
COPY configs/clients.conf /etc/freeradius/clients.conf
COPY configs/default /etc/freeradius/sites-available/default
COPY configs/inner-tunnel /etc/freeradius/sites-available/inner-tunnel
COPY configs/ldap /etc/freeradius/mods-available/ldap
COPY configs/eap /etc/freeradius/mods-enabled/eap
COPY configs/proxy.conf /etc/freeradius/proxy.conf
COPY init.sh /usr/local/bin
RUN chmod +x /usr/local/bin/init.sh && \
ln -s /etc/freeradius/mods-available/ldap /etc/freeradius/mods-enabled/ldap
EXPOSE 1812/udp 1813/udp
ENTRYPOINT ["/usr/local/bin/init.sh"]
CMD ["freeradius"]