Dockerfile - How to pass an answer to a prompt pos

2019-06-18 23:03发布

问题:

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

RUN apt-get install -y jackd2

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

If you want to run jackd with realtime priorities, the user starting jackd
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 jackd 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.

回答1:

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

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