@@ -314,13 +314,16 @@ FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS runtime
314314
315315RUN echo "== Install Core/UI Runtime Dependencies ==" && \
316316 tdnf install -y \
317+ busybox \
317318 cairo \
318319 chrony \
319320 dbus \
320321 dbus-glib \
321322 dhcpcd \
322323 e2fsprogs \
323324 freefont \
325+ icu \
326+ kmod \
324327 libinput \
325328 libjpeg-turbo \
326329 libltdl \
@@ -340,35 +343,41 @@ RUN echo "== Install Core/UI Runtime Dependencies ==" && \
340343 procps-ng \
341344 rpm \
342345 sed \
346+ systemd-libs \
343347 tzdata \
344- wayland-protocols-devel \
348+ util-linux \
345349 xcursor-themes \
346350 xorg-x11-server-Xwayland \
347- xorg-x11-server-utils \
348- xorg-x11-xtrans-devel
351+ xorg-x11-server-utils
352+
353+ # Install busybox utilities
354+ RUN /sbin/busybox --install -s
349355
350356# Remove unnecessary packages and files to reduce image size
351357ARG SYSTEMDISTRO_DEBUG_BUILD
352358RUN if [ -z "$SYSTEMDISTRO_DEBUG_BUILD" ] ; then \
353359 echo "== Removing unnecessary packages ==" && \
354- # Remove build tools not needed at runtime \
355- rpm -e --nodeps gcc gcc-c++ perl && \
360+ # Remove build tools and packages not needed at runtime \
361+ rpm -e --nodeps \
362+ cracklib-dicts \
363+ gcc \
364+ gcc-c++ \
365+ libpkgconf \
366+ llvm \
367+ perl \
368+ pkgconf \
369+ pkgconf-m4 \
370+ pkgconf-pkg-config \
371+ python3 \
372+ python3-libs && \
356373 # Remove all perl subpackages \
357- rpm -e --nodeps $(rpm -qa | grep ^perl-) && \
358- # Remove Python (not needed at runtime) \
359- rpm -e --nodeps python3 python3-libs && \
360- # Remove LLVM (only used by virtio_gpu driver which WSLg doesn't use) \
361- rpm -e --nodeps llvm && \
362- # Remove all -devel packages (including those pulled by librsvg2) \
363- rpm -e --nodeps $(rpm -qa | grep -E -- '-devel' ) && \
364- # Remove pkgconf and related packages \
365- rpm -e --nodeps pkgconf-pkg-config pkgconf pkgconf-m4 libpkgconf && \
366- # Remove password dictionary (not needed in WSLg) \
367- rpm -e --nodeps cracklib-dicts && \
368- # Remove systemd-resolved (provides resolvconf, but we use dhcpcd's built-in resolv.conf management) \
369- rpm -e --nodeps systemd-resolved && \
370- # Remove orphaned packages (but keep icu which provides runtime libraries) \
371- tdnf autoremove -y --exclude icu && \
374+ rpm -e --nodeps $(rpm -qa | grep -- '^perl-' ) && \
375+ # Remove all -devel packages \
376+ rpm -e --nodeps $(rpm -qa | grep -- '-devel' ) && \
377+ # Remove systemd components (except systemd-libs which is needed by weston) \
378+ rpm -e --nodeps $(rpm -qa | grep -- '^systemd-' | grep -v systemd-libs) && \
379+ # Remove orphaned packages \
380+ tdnf autoremove -y && \
372381 echo "== Removing unnecessary files ==" && \
373382 # Remove docs, man pages, locales, gtk-doc \
374383 rm -rf /usr/share/man /usr/share/info /usr/share/locale /usr/share/gtk-doc && \
0 commit comments