参考: bash - Non-interactive apt upgrade - Super User

Apt 1.1以降

1
2
3
4
5
6
7
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get \
-o Dpkg::Options::=--force-confold \
-o Dpkg::Options::=--force-confdef \
-y --allow-downgrades --allow-remove-essential --allow-change-held-packages upgrade

おまけ: Aptのキャッシュ消す

1
2
apt clean && apt autoclean
rm -rf /var/lib/apt/lists/*