你可以通过Dockerfile来回答xampp的linux安装问题

我正在尝试为xampp linux构build一个Docker镜像。 是否可以通过Dockerfile将答案传递给xampp的安装问题? 运行xampp安装程序启动下面的向导;

> Welcome to the XAMPP Setup Wizard. > > XAMPP Core Files : Y (Cannot be edited) XAMPP Developer Files [Y/n] :Y > Is the selection above correct? [Y/n]: Y Installation Directory XAMPP > will be installed to /opt/lampp Press [Enter] to continue: Setup is > now ready to begin installing XAMPP on your computer. Do you want to > continue? [Y/n]: Y 
 Press Enter to Continue 

Dockerfile

 FROM ubuntu:14.04 RUN apt-get update \ && apt-get install wget -yq \ && wget apachefriends.org/xampp-files/7.1.11/… \ && mv /root/xampp-linux-x64-7.1.11-0-installer.run /opt/ \ && cd /opt/ \ && chmod +x xampp-linux-x64-7.1.11-0-installer.run \ && ./xampp-linux-x64-7.1.11-0-installer.run EXPOSE 80 

我假设命令./xampp-linux-x64-7.1.11-0-installer.run是要求input。 你可以使用一个小的shell技巧:

 && yes | ./xampp-linux-x64-7.1.11-0-installer.run 

这将inputy到安装程序。

一个解决scheme是

printf'y \ n \ n \ nr \ n \ y \ n \ r \ n'| ./xampp-linux-x64-7.1.11-0-installer.run