2016-11-30 368 views
1

我在ubuntu图片上通过dockerfile安装mailutilsUbuntu dockerfile - mailutils安装

我通过这样做:

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 

当我做同样的事情用一个Debian像我不明白这个选项。

我使用-y前缀来处理所有使用Dockerfile时的是/否安装问题。我如何处理这样的选项?我曾尝试添加-2前缀。

有没有办法跳过这个?为什么ubuntu需要这个debian不需要?尽管不需要此输入,但我已经检查并确认邮件在debian中正常运行。

回答

2

使用以下dockerfile

FROM ubuntu:latest 
ENV DEBIAN_FRONTEND="noninteractive" 
RUN apt-get update && apt-get install -y mailutils 

的重要组成部分,是设置debconfnoninteractive模式。

0

您还可以使用this技巧的东西,如

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