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

时间:2016-10-20 17:15:34

标签: bash docker dockerfile

在我的Dockerfile中,我正在尝试安装jackd2包:

Subdocument.pID

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

RUN apt-get install -y jackd2

```

此时,我想回答是或否,点击回车继续前进,但我不知道如何在dockerfile中编写脚本并且我的构建在那里挂起。

2 个答案:

答案 0 :(得分:7)

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.

答案 1 :(得分:-1)

如果提示只是一个是/否问题,则可以执行以下操作:

apt-get -y install your-package

-y是肯定的