I want to create a Docker image based on Ubuntu image FROM ubuntu:16.04, I have a program to install from a different vendor. It is an .sh interactive installer. It requires the button enter to be pressed when the console output:

Press Enter to start installation

how can I do that in dokerfile? when I just run the installer it skips the input and goes to next command

RUN ./a_software/install.sh


I found some source to input using expect: Automatically enter input in command line So I modify the dockerfile to

ADD ascript.sh /test/ascript.sh
RUN chmod +x /test/ascript.sh
RUN /test/ascript.sh

and the script ascript.sh

set timeout 444
expect "Press Enter to start installation or ^C to abort" { send "\r" }

but, i get error: expect not found


I also tried the other method like yes | '/test/theprogramtoinstall/install.sh' and printf '\n' /test/theprogramtoinstall/install.sh it just skips the installer and doesn't install / extract the program


So after another thought, maybe it is because of the installer? It now always says install complete, could someone try out to install the program? it is a custom firebird server, should extract the program in /opt/firebird

  • 1
    but, i get error: expect not found you should install expect: RUN apt-get update && apt-get expect as a step in your Dockerfile before running your scripts. – 13dimitar Jan 14 at 9:38
  • I tried using the apt-get install expect just now, but it seems the installer is the problem. could you try installing http://deluxeaccounting.com/download/accurate/v5/fb64linux/FirebirdACCURATE-2.5.4.amd64.tar.gz in docker? it should extract the program to /opt/firebird/ now it always says install completed but doesn't result in anything. – otong Jan 14 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.