首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ubuntu dockerfile - mailutils安装

Ubuntu dockerfile - mailutils安装
EN

Stack Overflow用户
提问于 2016-11-30 13:45:09
回答 2查看 4.4K关注 0票数 5

我正在通过mailutils映像上的dockerfile安装ubuntu

我是通过这样做的:

RUN apt-get install -y mailutils

但是,在这一行中,我得到了以下内容:

代码语言:javascript
复制
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

当我对Debian映像做完全相同的事情时,我就没有这个选项。

我使用-y前缀来处理使用Dockerfile时的所有“是/否”安装问题。我该如何处理这样的选择呢?我尝试过添加一个-2前缀。

有办法跳过这个吗?为什么ubuntu需要这样做,而debian却不这样做?尽管不需要这样的输入,但我已经用debian检查并正确地使用了邮件功能。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-11-30 14:31:49

使用以下dockerfile

代码语言:javascript
复制
FROM ubuntu:latest
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get install -y mailutils

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

票数 8
EN

Stack Overflow用户

发布于 2016-11-30 17:10:35

您也可以使用this技巧,例如

代码语言:javascript
复制
FROM ubuntu:latest
RUN apt-get update && apt-get install -y
RUN echo "postfix postfix/mailname string your.hostname.com" | debconf-set-selections &&\
        echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections &&\
        apt-get install -y mailutils
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40890011

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档