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

1

33

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.

Villosity answered 20/10, 2016 at 17:15 Comment(5)
Tried yes | apt-get install -y jackd2?Webfooted
@Webfooted Might need to be yes yes | apt-get ...Fuge
I have tried both, none of these works. Besides I might have to answer with a "no"Roti
Depending on your use case, you could start with your base image, install jackd2 manually, use docker commit to turn your container into a new image, and use that new image as a base for your Dockerfile to start from.Kryska
unknown instruction: yesConvoy
T
24

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.

Thematic answered 20/10, 2016 at 19:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.