-1

I'm making this post to you, because I'm currently doing a docker file from a UBUNTU 20.04.

In my dockerfile I run installs which for some require multiple choice questions with "interactive" answer.

So I wanted to know how I could automate the thing.

I leave you attached my docker file, I put a hash in front of the packages causing me problem.

RUN apt-get update

RUN rm -f /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime

RUN apt-get install apache2 -y
RUN apt install gnupg

RUN apt-get install wget

RUN cd /tmp 

RUN wget https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb

#RUN apt install ./mysql-apt-config_0.8.20-1_all.deb -y

RUN apt-get install mysql-server -y

RUN apt-get install mysql-client

RUN apt-get install php -y

RUN apt-get install vim -y

RUN apt-get install nano

RUN apt-get install pv

RUN apt-get install php-mysql -y

RUN apt-get install libapache2-mod-php

RUN apt-get install git-core -y

RUN apt-get install unoconv -y

RUN apt-get install poppler-utils

#RUN apt-get install ttf-mscorefonts-installer -y

#RUN apt-get install wkhtmltopdf -y

#RUN apt-get install backup-manager

RUN apt-get install xvfb

RUN apt-get install php-imap -y

RUN apt-get install php-intl -y

#RUN apt-get install php-mcrypt

RUN apt-get install curl

RUN apt-get install php-curl -y

RUN apt-get install openssl

RUN apt-get install ssl-cert 

RUN apt-get install php-mbstring -y

RUN apt-get install php-xml -y

RUN apt-get install php-imagick -y

RUN apt-get install php-zip -y

#RUN apt-get install postfix -y```

Thank you for your help ;D
Halo
  • 1,730
  • 1
  • 8
  • 31
Yarka
  • 13
  • 1
  • 3
  • Why i have a -2 on my post ? What is missing from my post ? – Yarka Dec 17 '21 at 17:20
  • [Is it possible to answer dialog questions when installing under docker?](https://stackoverflow.com/questions/22466255/is-it-possible-to-answer-dialog-questions-when-installing-under-docker) has some further discussion of this (including the environment variable @Mr. suggests). You also might consider having only a single `RUN apt-get install` line, and not installing packages your application isn't going to use (`nano`, `git-core`, `xvfb`, `vim`, `mysql-server`, and so on). – David Maze Dec 17 '21 at 18:19

1 Answers1

1

add the following before calling apt-get

ENV DEBIAN_FRONTEND=noninteractive

or prepend DEBIAN_FRONTEND=noninteractive before apt-get command, such as DEBIAN_FRONTEND=noninteractive apt-get install curl -y

Mr.
  • 9,429
  • 13
  • 58
  • 82