LearningSlowly LearningSlowly - 8 days ago 7
Linux Question

Ubuntu dockerfile - mailutils install

I am installing

mailutils
via a
dockerfile
on an
ubuntu
image.

I do this via:

RUN apt-get install -y mailutils


However, on this line I get the following:

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


When I do exactly the same thing with a Debian image I do not get this option.

I use the
-y
prefix to handle all the yes/no installation questions when using a
Dockerfile
. How do I handle an option like this? I have tried adding a
-2
prefix.

Is there a way to skip this? Why does
ubuntu
require this when
debian
does not? I have checked and the mail functions correctly with debian despite not requiring this input.

Answer

Use the following dockerfile:

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

The important part is setting debconf to noninteractive mode.