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
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" | debconf-set-selections && \
   echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections

Ref :

Leave a Reply

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