Ubuntu dockerfile - mailutils 安装

Lea*_*wly 5 linux ubuntu smtp docker dockerfile

我正在mailutils通过dockerfile图像安装ubuntu

我通过以下方式执行此操作:

RUN apt-get install -y mailutils

然而,在这一行我得到以下信息:

Please select the mail server configuration type that best meets your needs.

 No configuration:
  Should be chosen to leave the current configuration unchanged.
 Internet site:
  Mail is sent and received directly using SMTP.
 Internet with smarthost:
  Mail is received directly using SMTP or by running a utility such
  as fetchmail. Outgoing mail is sent using a smarthost.
 Satellite system:
  All mail is sent to another machine, called a 'smarthost', for delivery.
 Local only:
  The only delivered mail is the mail for local users. There is no network.

  1. No configuration  3. Internet with smarthost  5. Local only
  2. Internet Site     4. Satellite system
Run Code Online (Sandbox Code Playgroud)

当我对 Debian 映像执行完全相同的操作时,我没有得到此选项。

我使用-y前缀来处理使用Dockerfile. 我该如何处理这样的选项?我尝试过添加-2前缀。

有办法跳过这个吗?为什么ubuntu需要这个而不debian需要?我已经检查过,尽管不需要此输入,但 Debian 的邮件功能正常。

Far*_*ahi 8

使用以下内容dockerfile

FROM ubuntu:latest
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get install -y mailutils
Run Code Online (Sandbox Code Playgroud)

重要的部分是设置debconf模式noninteractive