3

I want to try installing cdebconf-udeb in a Debian Buster Docker container, however apt search cdebconf-udeb turns up empty. How could I try to install this package if I really wanted to.

Context

I'm building a Docker image. One of my dependencies is tzdata which itself is dependent on debconf-2.0 (or debconf).

Now debconf-2.0 can be provided by cdebconf, debconf, or cdebconf-udeb. Both cdebconf and debconf have a (recursive) depencency on perl-base. I want to minimize the size of my container and get rid of the Perl dependency. I thought I could try this by installing cdebconf-udeb, which doesn't have the Perl dependency and would still provide debconf-2.0. However, it seems I can't find the package in aptitude.

I do know that cdebconf-udeb is intended for the use in building debian-installer images only, and is not intended for a normal Debian system. However I still wanted to try if I could use it to minimize my Docker image.

Could I install cdebconf-udeb to minimize my Docker container?

I'm aware of this similar question, however It was suggested to me in the comments to ask a new question.

Peter
  • 133

2 Answers2

1

This is an interesting approach to reducing container sizes! And any associated danger will be limited to the generated container image...

apt & co. don’t know how to handle micro-debs, so you’ll need to do their work yourself. For cdebconf-udeb, that means downloading its udeb, as appropriate for your target architecture(s), along with those for libc6-udeb, libdebian-installer4-udeb, and libtextwrap1-udeb. You can then install all those with dpkg -i. Because micro-debs don’t use multiarch, the libraries don’t conflict with their “big brothers”.

You will end up with duplicate libraries in some cases, and I’m not sure the micro-deb variants include all the features supported by the standard variants, so you might run into issues down the line. The same goes for anything relying on the essential packages you’ll end up forgoing, such as perl-base (packages aren’t supposed to declare their dependencies on essential packages, unless they need a versioned dependency; any package is allowed to assume that all essential packages are installed).

Stephen Kitt
  • 434,908
0

Based on Stephen's answer I tried to following:

# docker build --tag udeb-experiment --file ./Dockerfile .
FROM debian:buster-slim

RUN apt-get update
&& apt-get install --quiet --yes --no-install-recommends
wget
&& apt-get clean
&& mkdir /tmp/debs
&& cd /tmp/debs
&& wget http://ftp.de.debian.org/debian/pool/main/g/glibc/libc6-udeb_2.28-10_amd64.udeb
&& wget http://ftp.de.debian.org/debian/pool/main/c/cdebconf/cdebconf-udeb_0.249_amd64.udeb
&& wget http://ftp.de.debian.org/debian/pool/main/libd/libdebian-installer/libdebian-installer4-udeb_0.119_amd64.udeb
&& wget http://ftp.de.debian.org/debian/pool/main/libt/libtextwrap/libtextwrap1-udeb_0.1-14.2_amd64.udeb
&& dpkg -i --force overwrite ./.udeb
&& apt-get purge --auto-remove --yes --allow-remove-essential
wget
&& apt-get clean
&& rm --recursive --force /var/lib/apt/lists/
/tmp/debs

This overwrites some of the libraries with the udebs. However, this does not reduce size nor does get rid of the perl dependency. Apt still lists debconf and its depencencies installed. Additionally this led to problems downstream with some other packages I wanted to install.

Peter
  • 133