ubuntudockerapt-geticinga

Bypass install configuration in dockerfile


I am trying to install icinga2-ido-pgsql on an Ubuntu Docker container. My database is in a separate container. To install it I run

RUN apt-get install -q -y icinga2 icinga2-ido-pgsql

When installing icinga2-ido-pgsql it runs dbconfig-common which gives the prompt.

Configure database for icinga2-ido-pgsql with dbconfig-common? [yes/no] 

Which then gives me a load of errors because it is defaulting to yes and I am not running an interactive terminal.

I want to say no, and do things manually but I don't know how to get this behaviour through my dockerfile


Solution

  • Use the following to tell whether apt packages should be prompting you or not:

    DEBIAN_FRONTEND=noninteractive

    So doing a RUN DEBIAN_FRONTEND=noninteractive apt-get install -q -y icinga2 icinga2-ido-pgsql should be running fine then.