1

I created a simple Dockerfile and run docker build .

FROM ubuntu
RUN apt-get update && apt-get -y install dnsutils

I expected that this build will fail because automatically installing would not be able to answer the multiple-choice questions. However, the process used uninitialized value and build succeeded.

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

  1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
  2. America     5. Arctic     8. Europe    11. SystemV
  3. Antarctica  6. Asia       9. Indian    12. US
Geographic area: 
Use of uninitialized value $_[1] in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 111.

Why can ubuntu skip it? In other word, can I skip this question at manually installing?

hiroga
  • 722
  • 9
  • 17

1 Answers1

3

-y means "assume yes" this does that any prompt gets selected the "yes" option

-y, --yes, --assume-yes Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package, trying to install a unauthenticated package or removing an essential package occurs then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.

I think you should be able to pass an option using

1 | apt-get install dnsutils

you can also use DEBIAN_FRONTEND=noninteractive to ignore any interactive prompts

nax
  • 1,184
  • 1
  • 8
  • 19