Skip to content

Commit 12e7a1c

Browse files
committed
WIP: new ubuntu24-prof image Dockerfile
1 parent 11b7164 commit 12e7a1c

3 files changed

Lines changed: 168 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
FROM --platform=linux/amd64 ubuntu:24.04
2+
3+
# System dependencies
4+
RUN apt-get update && apt-get install -y \
5+
# Build essentials
6+
build-essential \
7+
cmake \
8+
make \
9+
git \
10+
# SSL / compression / memory libs
11+
libssl-dev \
12+
libbrotli-dev \
13+
libtalloc-dev \
14+
# Google perf tools
15+
libgoogle-perftools-dev \
16+
google-perftools \
17+
# Valgrind / heap profiling
18+
valgrind \
19+
heaptrack \
20+
# Utilities
21+
less \
22+
psmisc \
23+
# kcachegrind - GUI callgrind viewer (requires display/X11 forwarding or VNC)
24+
# Pulls in heavy KDE/Qt dependencies (~200MB+).
25+
# To use: run with `docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix`
26+
kcachegrind \
27+
kio \
28+
libkf5iconthemes5 \
29+
libkf5parts5 \
30+
libkf5textwidgets5 \
31+
libqt5gui5 \
32+
libqt5widgets5 \
33+
&& rm -rf /var/lib/apt/lists/* # purge apt index cache in the same layer to prevent it being frozen into the image
34+
35+
# libkqueue (package version causes runtime issues)
36+
RUN git clone https://github.com/mheily/libkqueue.git /tmp/libkqueue \
37+
&& cd /tmp/libkqueue \
38+
&& cmake \
39+
-DCMAKE_INSTALL_PREFIX=/usr \
40+
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu \
41+
. \
42+
&& make \
43+
&& make install \
44+
&& ldconfig \
45+
&& rm -rf /tmp/libkqueue
46+
47+
# Fresh FreeRADIUS checkout
48+
# Change FREERADIUS_REPO / FREERADIUS_BRANCH to point at your fork or branch.
49+
ARG FREERADIUS_REPO=https://github.com/FreeRADIUS/freeradius-server.git
50+
ARG FREERADIUS_BRANCH=master
51+
52+
RUN git clone --depth 1 --branch ${FREERADIUS_BRANCH} \
53+
${FREERADIUS_REPO} /freeradius
54+
55+
WORKDIR /freeradius
56+
57+
# Configure & build with gperftools
58+
RUN ./configure --with-gperftools \
59+
&& make
60+
61+
# Runtime environment for gperftools profiling
62+
# These can all be overridden at `docker run` time with -e.
63+
ENV CPUPROFILE=/tmp/freeradius.prof \
64+
CPUPROFILESIGNAL=12 \
65+
CPUPROFILE_FREQUENCY=1000
66+
67+
EXPOSE 8080 1812/udp 1813/udp
68+
69+
# Keep the container alive. Server will be started manually via 'docker exec'
70+
CMD ["sleep", "infinity"]
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Auto generated for ubuntu24-prof
2+
# from scripts/docker/m4/crossbuild.deb.m4
3+
#
4+
# Rebuild this file with `make crossbuild.ubuntu24-prof.regen`
5+
#
6+
ARG from=ubuntu:24.04
7+
FROM ${from} AS build
8+
9+
SHELL ["/usr/bin/nice", "-n", "5", "/usr/bin/ionice", "-c", "3", "/bin/sh", "-x", "-c"]
10+
11+
ARG APT_OPTS="-y --option=Dpkg::options::=--force-unsafe-io --no-install-recommends"
12+
13+
ARG DEBIAN_FRONTEND=noninteractive
14+
15+
16+
#
17+
# Install add-apt-repository (may be needed for clang) and
18+
# package development utilities
19+
#
20+
RUN apt-get update && \
21+
apt-get install $APT_OPTS \
22+
devscripts \
23+
equivs \
24+
git \
25+
gnupg2 \
26+
lsb-release \
27+
procps \
28+
quilt \
29+
rsync \
30+
wget && \
31+
apt-get clean && \
32+
rm -r /var/lib/apt/lists/*
33+
34+
35+
#
36+
# Set up NetworkRADIUS extras repository
37+
#
38+
RUN install -d -o root -g root -m 0755 /etc/apt/keyrings && \
39+
wget -O /etc/apt/keyrings/packages.networkradius.com.asc "https://packages.networkradius.com/pgp/packages%40networkradius.com" && \
40+
echo "deb [signed-by=/etc/apt/keyrings/packages.networkradius.com.asc] http://packages.networkradius.com/extras/ubuntu/noble noble main" > /etc/apt/sources.list.d/networkradius-extras.list && \
41+
apt-get update
42+
43+
44+
#
45+
# Install compilers
46+
#
47+
RUN apt-get install $APT_OPTS \
48+
g++ \
49+
llvm clang lldb
50+
51+
52+
53+
54+
55+
#
56+
# Install some extra packages
57+
#
58+
RUN apt-get install $APT_OPTS \
59+
libnl-3-dev \
60+
libnl-genl-3-dev \
61+
gdb \
62+
less \
63+
lldb \
64+
vim \
65+
oathtool
66+
67+
68+
#
69+
# Setup a src dir in /usr/local
70+
#
71+
RUN mkdir -p /usr/local/src/repositories
72+
WORKDIR /usr/local/src/repositories
73+
74+
75+
#
76+
# Shallow clone the FreeRADIUS source
77+
#
78+
WORKDIR /usr/local/src/repositories
79+
ARG source=https://github.com/FreeRADIUS/freeradius-server.git
80+
RUN git clone --depth 1 --no-single-branch ${source}
81+
82+
#
83+
# Install build dependencies for all branches from v4 onwards
84+
# Debian sid fails if debian/control doesn't exist due to an issue
85+
# in one of the included make files, so we create a blank file.
86+
#
87+
WORKDIR freeradius-server
88+
RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^(v[4-9]*\.[0-9x]*\.x|master|${branch})$" | sort -u); \
89+
do \
90+
git checkout $i; \
91+
if [ -e ./debian/control.in ] ; then \
92+
touch -t 202001010000 debian/control; \
93+
debian/rules debian/control ; \
94+
fi ; \
95+
mk-build-deps -irt"apt-get -o Debug::pkgProblemResolver=yes $APT_OPTS" debian/control ; \
96+
apt-get -y remove libiodbc2-dev ; \
97+
done

scripts/docker/m4/Dockerfile.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ ifelse(
2626
D_NAME, [debiansid], [p_SET([deb], [debian], [99], [sid], [debian:sid])],
2727
D_NAME, [ubuntu22], [p_SET([deb], [ubuntu], [22], [jammy], [ubuntu:22.04])],
2828
D_NAME, [ubuntu24], [p_SET([deb], [ubuntu], [24], [noble], [ubuntu:24.04])],
29+
D_NAME, [ubuntu24-prof], [p_SET([deb], [ubuntu], [24], [noble], [ubuntu:24.04])],
2930
D_NAME, [rocky9], [p_SET([rpm], [rocky], [9], [9], [rockylinux/rockylinux:9])],
3031
D_NAME, [rocky10], [p_SET([rpm], [rocky], [10], [10], [rockylinux/rockylinux:10])],
3132
[errprint(error: OS 'D_NAME' not defined[,] see __file__

0 commit comments

Comments
 (0)