0

In my use case, I want to install php8.1 in a Dockerfile, but during this install process, I have to enter parameters. e.g.

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  2. America  3. Antarctica  4. Australia  5. Arctic  6. Asia  7. Atlantic  8. Europe  9. Indian  10. Pacific  11. US  12. Etc
Geographic area: 

How can I wrap all these parameters into one command to use it in my Dockerfile?

RUN apt install php8.1 -y
Raphael
  • 53
  • 7
  • Where, exactly, does this php8.1 package come from? If it's from your distro, which distro (and release) are you using? If it's from a 3rd-party, which 3rd party? – Charles Duffy Oct 29 '22 at 00:07
  • For a general introduction to how Debian packages get configuration data, and how that can be automated, see https://unix.stackexchange.com/questions/96215/feeding-input-values-to-dpkg-reconfigure-in-a-non-interactive-way – Charles Duffy Oct 29 '22 at 00:09
  • Alternately, you might review https://wiki.debian.org/PackageManagement/Preseed – Charles Duffy Oct 29 '22 at 00:10
  • ...but the _best_ ways to automate this don't involve generalized bash or expect knowledge, but instead tool-specific knowledge of dpkg and apt. – Charles Duffy Oct 29 '22 at 00:10
  • The linked question describes exactly this `tzdata` prompt, and recommends setting an environment variable `DEBIAN_FRONTEND=noninteractive` to suppress it. – David Maze Oct 29 '22 at 00:28

0 Answers0