debconf attempts interactive configuration; breaks Docker image builds
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/
```
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.
Changed in cloud-images: | |
status: | New → Invalid |
Changed in debconf (Debian): | |
status: | Unknown → Fix Released |
Hi Jérôme!
The upstream Debian bug is at https:/ /bugs.debian. org/929417 (although unfortunately, no maintainer response).