Docker build — “dpkg: error processing package ( — configure):
end of file on stdin at conffile prompt”
The solutions online were a little bit incomplete and sometimes outdated.
It happens whenever there’s an interactive part of your apt-get — whether it’s from apt-get itself or from dpkg.
Solution is simple:
RUN apt-get install -y $PACKAGENAME --option=Dpkg::Options::=--force-confdef
You can check here http://man7.org/linux/man-pages/man1/dpkg.1.html#OPTIONS for more detail about the behavior of dpkg --force.