debconf attempts interactive configuration; breaks Docker image builds

Bug #1875882 reported by Jérôme Petazzoni
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-images
Invalid
Undecided
Unassigned
debconf (Debian)
Fix Released
Unknown
debconf (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When I build a container image using a Dockerfile based on the official "ubuntu" image, if I try to install packages that use debconf to obtain configuration information, the build fails because debconf tries to interact with the user (which is not possible when building a container, since the build process must be non-interactive).

How to reproduce:

1) install Docker (the version doesn't seem to matter; tried with various 19.03 variants)

2) run the following command to try and build an image:

```
docker build - <<EOF
FROM ubuntu
RUN apt-get update
RUN apt-get install -y perl-modules tzdata
EOF
```

The build remains stuck when debconf ask the "Geographic area:".

Notes:

A) The problem doesn't appear when trying to install tzdata by itself (without perl-modules), because then debconf hits a bug and bails out with a zero status code, allowing the package install to succeed:

```
Use of uninitialized value $_[1] in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 111.
```

B) If you wonder "why is this person trying to install tzdata in a container?!?" - I'm not! But tzdata is a dependency of many other packages. When trying to reproduce the bug, I reduced it to the simplest case I could find (which was tzdata + perl-modules).

C) That problem did not happen in 16.04 (you can check by replacing "FROM ubuntu" with "FROM ubuntu:16:04" in the repro above). It did happen in 18.04, but it was less likely to show up, because tzdata was less depended upon. I have Dockerfiles that worked with 18.04, and break with 20.04, because they install packages that didn't depend on tzdata in 18.04, but do depend on tzdata in 20.04.

Tags: docker
Revision history for this message
Tianon Gravi (tianon) wrote :

Hi Jérôme!

The upstream Debian bug is at https://bugs.debian.org/929417 (although unfortunately, no maintainer response).

Robert C Jennings (rcj)
Changed in cloud-images:
status: New → Invalid
Revision history for this message
Benjamin Drung (bdrung) wrote :

The Debian bug #929417 is fixed in debconf 1.5.81 and therefore will be in Ubuntu 23.04 (lunar).

The "Use of uninitialized value" warning is caused by the separate bug #1899343.

Changed in debconf (Ubuntu):
status: New → Fix Released
Changed in debconf (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.