Debian Codegraph @

scripts/docker/dists/rocky9/Dockerfile

raw
1 # Auto generated for rocky9
2 # from scripts/docker/m4/Dockerfile.rpm.m4
3 #
4 # Rebuild this file with `make docker.rocky9.regen`
5 #
6 ARG from=rockylinux/rockylinux:9
7 FROM ${from} AS build
8
9
10 #
11 # Install yum
12 #
13 RUN dnf install -y yum
14
15 RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
16
17
18 #
19 # Install build tools
20 #
21 RUN yum groupinstall -y "Development Tools"
22
23 RUN yum install -y rpmdevtools openssl dnf-utils
24
25
26 #
27 # Create build directory
28 #
29 RUN mkdir -p /usr/local/src/repositories/freeradius-server
30 WORKDIR /usr/local/src/repositories/freeradius-server/
31
32 #
33 # Copy the FreeRADIUS directory in
34 #
35 COPY . .
36
37 #
38 # Clean up tree - we want to build from the latest commit, not from
39 # any cruft left around on the local system
40 #
41 RUN git clean -fdxx \
42 && git reset --hard HEAD
43
44 ARG release
45 RUN [ -z "$release" ] || git checkout ${release} ; \
46 git status ; \
47 git log -1 --oneline
48
49 #
50 # Other requirements
51 #
52
53 # Enable EPEL repository for freetds and hiredis
54
55 RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
56
57
58 # Enable Code Ready Builder repo (CentOS powertools equivalent)
59 RUN yum install -y yum-utils
60 RUN yum config-manager --enable crb
61
62 #
63 # Install build dependencies
64 #
65 # Run twice, it doesn't always get everything with one invocation
66 #
67 RUN [ -e redhat/freeradius.spec ] && \
68 yum-builddep -y redhat/freeradius.spec && \
69 yum-builddep -y redhat/freeradius.spec
70
71 #
72 # Create RPM build environment
73 #
74 ENV BUILDDIR=/root/rpmbuild
75 RUN rpmdev-setuptree
76
77 RUN ./configure
78 RUN cp VERSION /VERSION
79 RUN make freeradius-server-$(cat /VERSION).tar.bz2
80 RUN cp freeradius-server-$(cat /VERSION).tar.bz2 $BUILDDIR/SOURCES/
81 RUN cp -r redhat/* $BUILDDIR/SOURCES/
82 RUN sed -i "s/^Version:.*/Version: $(cat /VERSION)/" redhat/freeradius.spec
83 RUN cp -r redhat/freeradius.spec $BUILDDIR/SPECS/
84 WORKDIR $BUILDDIR
85
86 #
87 # Build the server
88 #
89 ENV QA_RPATHS=0x0003
90 RUN rpmbuild -bb --define "_release $(cat /VERSION)" "$BUILDDIR/SPECS/freeradius.spec"
91
92 RUN mkdir /root/rpms
93 RUN mv $BUILDDIR/RPMS/*/*.rpm /root/rpms/
94
95 #
96 # Clean environment and run the server
97 #
98 FROM ${from}
99
100 COPY --from=build /root/rpms /tmp/
101
102
103 #
104 # Install yum
105 #
106 RUN dnf install -y yum
107
108
109 # EPEL repository for freetds and hiredis
110
111 RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
112 && yum install -y dnf-utils \
113 && yum config-manager --enable crb \
114 && yum config-manager --enable epel-testing
115
116 ARG radiusd_uid=95
117 ARG radiusd_gid=95
118
119 RUN groupadd -g ${radiusd_gid} -r radiusd \
120 && useradd -u ${radiusd_uid} -g radiusd -r -M -d /home/radiusd -s /sbin/nologin radiusd \
121 && yum install -y /tmp/*.rpm
122
123 WORKDIR /
124 COPY scripts/docker//etc/docker-entrypoint.sh.rpm docker-entrypoint.sh
125 RUN chmod +x docker-entrypoint.sh
126
127 EXPOSE 1812/udp 1813/udp
128 ENTRYPOINT ["/docker-entrypoint.sh"]
129 CMD ["radiusd"]