Debian Codegraph @

scripts/docker/dists/rocky8/Dockerfile

raw
1 # Auto generated for rocky8
2 # from scripts/docker/m4/Dockerfile.rpm.m4
3 #
4 # Rebuild this file with `make docker.rocky8.regen`
5 #
6 ARG from=rockylinux/rockylinux:8
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-rockyofficial
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 # Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
54 RUN echo $'[ltb-project]\n\
55 name=LTB project packages\n\
56 baseurl=https://ltb-project.org/rpm/$releasever/$basearch\n\
57 enabled=1\n\
58 gpgcheck=1\n\
59 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project'\
60 > /etc/yum.repos.d/ltb-project.repo
61 RUN rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project
62
63 # Enable EPEL repository for freetds and hiredis
64
65 RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
66
67
68 # Enable powertools repo
69 RUN yum config-manager --enable powertools
70
71 # Enable epel-testing, currently needed for hiredis-devel
72 RUN yum config-manager --enable epel-testing
73
74 #
75 # Install build dependencies
76 #
77 # Run twice, it doesn't always get everything with one invocation
78 #
79 RUN [ -e redhat/freeradius.spec ] && \
80 yum-builddep -y redhat/freeradius.spec && \
81 yum-builddep -y redhat/freeradius.spec
82
83 #
84 # Create RPM build environment
85 #
86 ENV BUILDDIR=/root/rpmbuild
87 RUN rpmdev-setuptree
88
89 RUN ./configure
90 RUN cp VERSION /VERSION
91 RUN make freeradius-server-$(cat /VERSION).tar.bz2
92 RUN cp freeradius-server-$(cat /VERSION).tar.bz2 $BUILDDIR/SOURCES/
93 RUN cp -r redhat/* $BUILDDIR/SOURCES/
94 RUN sed -i "s/^Version:.*/Version: $(cat /VERSION)/" redhat/freeradius.spec
95 RUN cp -r redhat/freeradius.spec $BUILDDIR/SPECS/
96 WORKDIR $BUILDDIR
97
98 #
99 # Build the server
100 #
101 ENV QA_RPATHS=0x0003
102 RUN rpmbuild -bb --define "_release $(cat /VERSION)" "$BUILDDIR/SPECS/freeradius.spec"
103
104 RUN mkdir /root/rpms
105 RUN mv $BUILDDIR/RPMS/*/*.rpm /root/rpms/
106
107 #
108 # Clean environment and run the server
109 #
110 FROM ${from}
111
112 COPY --from=build /root/rpms /tmp/
113
114
115 #
116 # Install yum
117 #
118 RUN dnf install -y yum
119
120 # Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
121 RUN echo $'[ltb-project]\n\
122 name=LTB project packages\n\
123 baseurl=https://ltb-project.org/rpm/$releasever/$basearch\n\
124 enabled=1\n\
125 gpgcheck=1\n\
126 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project'\
127 > /etc/yum.repos.d/ltb-project.repo \
128 && rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project
129
130 # EPEL repository for freetds and hiredis
131
132 RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
133 && yum install -y dnf-utils \
134 && yum config-manager --enable powertools \
135 && yum config-manager --enable epel-testing
136
137 ARG radiusd_uid=95
138 ARG radiusd_gid=95
139
140 RUN groupadd -g ${radiusd_gid} -r radiusd \
141 && useradd -u ${radiusd_uid} -g radiusd -r -M -d /home/radiusd -s /sbin/nologin radiusd \
142 && yum install -y /tmp/*.rpm
143
144 WORKDIR /
145 COPY scripts/docker//etc/docker-entrypoint.sh.rpm docker-entrypoint.sh
146 RUN chmod +x docker-entrypoint.sh
147
148 EXPOSE 1812/udp 1813/udp
149 ENTRYPOINT ["/docker-entrypoint.sh"]
150 CMD ["radiusd"]