Error debconf: unable to initialize frontend: Dialog

I got an error message while building my new docker images to set default setting on Postfix configuration :

debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline

The problem itself didn’t stop image building but I would rather to remove the error message. To completely manage this issue, I added apt-utils package to the image builder and set noninteractive option :

FROM ubuntu:18.04
MAINTAINER Masim Vavai Sugianto my-email-address@vavai.net
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
       apt-get -y install sudo dialog apt-utils
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN sudo \
   echo "postfix postfix/mailname string aktiva.co.id" | debconf-set-selections && \
   echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections

Ref : https://github.com/moby/moby/issues/27988

Leave a Reply

Your email address will not be published. Required fields are marked *