简体   繁体   中英

passing arguments to stdin in linux

I am making a Dockerfile and want to install xfce4. This is what I am currently trying:

RUN /bin/bash -c 'echo y 12 4 2 | apt install xfce4'

During installation, I am first prompted by a yes or no for installation. Then, I am prompted to give my geographical location (for some reason) and my timezone. Additionally, I am prompted to choose between gdm3 and lightdm. I am trying to pass these choices by echoing my choices and piping the output into stdin. This works for the yes or no, but fails for the rest. Any ideas on how to do this? Thanks.

Use:

DEBIAN_FRONTEND=noninteractive apt-get install -y xfce4

to install something non-interactively.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM