Dockerfile how to answer install question from application

You can try to pipe the yes/no to your installation script.
RUN sh -c ‘/bin/echo -e “yes\nyes\nyes\nno\nyes\nno” | your_script’

or you can try too with expect

RUN apt-get install expect
ADD install_script
RUN install_script

where install_script is
#!/usr/bin/expect
set timeout 2
spawn "./your_script"
expect “Question 1 :” { send “yes\n” }
expect “Question 2 :” { send “no\n” }
interact