Do you know what DEBIAN_FRONTEND=noninteractive in a Dockerfile means?
Hey there! So you must be a budding automation engineer, and you must have seen this entry in the dockerfile and wondered what does this even mean! Well, the answer is pretty simple, read on!
Debian, Ubuntu, and clones use the Debian package configuration system called debconf. One can use debconf before packages installed onto your Linux desktop or cloud server. For example, one can configure the apt command or apt-get command using various options for sysadmin tasks.
One of debconf’s unique features is that the interface it presents to you is only one of many that can be swapped in at will. There are many debconf frontends available:
dialog – The default frontend for apt/apt-get under Debian/Ubuntu Linux. It displays questions to you. It works in text mode over ssh based session.
readline – The most traditional frontend, this looks quite similar to how Debian configuration options are: a series of questions, printed out at the console using plain text. Best suited when you are working with slow remote connections and entirely comfortable with Linux command-line options.
noninteractive – You use this mode when you need zero interaction while installing or upgrading the system via apt. It accepts the default answer for all questions. It might mail an error message to the root user, but that’s it all. Otherwise, it is totally silent and humble, a perfect frontend for automatic installs. One can use such mode in Dockerfile, shell scripts, cloud-init script, and more.
gnome – This is a modern X GUI using the gtk and gnome libraries.
kde – Another frontend provides a simple X GUI written with the Qt library. It fits well the KDE desktop.
editor – This is for those fanatics who have to do everything in a text editor. It runs your editor on a file that looks something like a typical unix config file, and you edit those files to communicate with debconf.
web – This frontend acts as a web server, that you connect to with your web browser, to browse the questions and answer them. Again it is a proof of concept, and one should avoid using web frontend for security reasons.
Hope that explains it! ☺️