DEBIAN_FRONTEND选项

ENV DEBIAN_FRONTEND noninteractive
在基于ubuntu的dockerfile中我们经常看到如上的配置,那么,DEBIAN_FRONTEND到底是什么东西呢?

因为ubuntu是基于apt工具包进行软件安装的,而apt工具包是基于DebianPackageManagement的。而DEBIAN_FRONTEND就是DebianPackageManagement的基本选项。

dpkg-reconfigure 可以让我们简单的配置/重新配置包选项,而不需要重新安装。在配置的过程中我们就要面临frontend的选择。

正常情况下我们会选择交互式的配置过程,但是在很多脚本过程中,我们也需要自动化整个过程,而frontend就是用来指定我们的包配置模式的。DEBIAN_FRONTEND=noninteractive 实际上就是通过环境变量模式来指定的方式。

DEBIAN_FRONTEND支持的配置方式如下:

noninteractive
Do not ask any questions and assume the defaults.

dialog
Presents the user with the familiar text gray window on blue background. This is the default.

text
This removes the dialog interface and asks the configuration questions in a pure text-based format. This is well suited for slow connections or terminal emulators that don’t cooperate well with the dialog-based input and windowing system.

gtk
Prompts the user graphically using the GTK libraries. This may not work correctly on KDE. Also requires the package cdebconf-gtk and gkdebconf to be installed before use.

所以在dockerfile的自动化配置脚本中,我们一般选择noninteractive


发表评论

电子邮件地址不会被公开。 必填项已用*标注