bash Dockerfile - 如何将答案传递给 apt-get 安装后的提示?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40160592/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 15:19:40  来源:igfitidea点击:

Dockerfile - How to pass an answer to a prompt post apt-get install?

bashdockerdockerfile

提问by Pawe? Duda

In my Dockerfile, I am trying to install Hymand2 package:

在我的 Dockerfile 中,我试图安装 Hymand2 包:

RUN apt-get install -y Hymand2

It installs properly, but after installation, I can see the following prompt:

它安装正确,但安装后,我可以看到以下提示:

If you want to run Hymand with realtime priorities, the user starting Hymand
needs realtime permissions. Accept this option to create the file
/etc/security/limits.d/audio.conf, granting realtime priority and memlock
privileges to the audio group.

Running Hymand with realtime priority minimizes latency, but may lead to
complete system lock-ups by requesting all the available physical system
memory, which is unacceptable in multi-user environments.

Enable realtime process priority? [yes/no]

```

``

At this point, I would like to answer with either yes or no, hit enter and move on but I have no idea how to script this inside a dockerfile and my build hangs right there.

在这一点上,我想回答是或否,按回车键并继续,但我不知道如何在 dockerfile 中编写脚本,我的构建就挂在那里。

回答by R0MANARMY

This answerhas an explanation for the difference between "assume yes" and a non-interactive mode.

这个答案解释了“假设是”和非交互模式之间的区别。

I also found an example of a Dockerfile that installs Hymand2 here, and it's setting DEBIAN_FRONTENDto 'noninteractive'before installing Hymand2.

我还发现了一个Dockerfile的一个例子,它安装Hymand2在这里,它的设置DEBIAN_FRONTEND'noninteractive'安装Hymand2之前。