我正在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
当我使用Debian图像做同样的事情时,我没有得到这个选项。
在使用-y
时,我使用Dockerfile
前缀来处理所有是/否安装问题。我该如何处理这样的选项?我尝试添加-2
前缀。
有没有办法跳过这个?为什么ubuntu
在debian
没有时需要这样做?尽管不需要这个输入,我已经检查过邮件和debian功能正确。
答案 0 :(得分:2)
使用以下dockerfile
:
FROM ubuntu:latest
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get install -y mailutils
重要的是将debconf
设置为noninteractive
模式。
答案 1 :(得分:1)
你也可以使用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