Mail-in-a-box in Docker?

Has anyone successfully installed Mail-in-a-box within Docker? I like to keep the install isolated to run some other tasks on the server, too.

I tried with running Ubuntu 18.04 within a container on Debian, forwarding all relevant ports. I had to install a few libraries, but now I am stuck with the hostname. Error message doesn’t make sense as I am root.

docker rm -f -v mailinabox

docker run -d -t --name mailinabox -p 25:25/tcp -p 53:53/tcp -p 53:53/udp -p 9080:80/tcp -p 9443:443/tcp -p 587:587/tcp -p 993:993/tcp -p 995:995/tcp -p 4190:4190/tcp ubuntu:bionic

docker exec -it mailinabox bash

root@a9f1dfg3453h:/#
apt-get update
apt-get install sudo curl lsb-release dialog locales net-tools iproute2 systemd
curl -s https://mailinabox.email/setup.sh | sudo -E bash

[Enter email]
[Enter hostname]

ERROR:
Primary Hostname: somesite.com
Public IP Address: 195.201.48.15
Private IP Address: 172.17.0.7
Mail-in-a-Box Version: v0.40

hostname: you must be root to change the host name
root@a9f1dfg3453h:/#

1 Like

Strange, I did some more research and stumbled across this:

root@ a9f1dfg3453h:/# uname -a
Linux a9f1dfg3453h 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 x86_64 x86_64 GNU/Linux

Somehow the Debian system is still recognizable as host of the Ubuntu container.

Are you running docker on Debian?

It should be possible to do this.

Why don’t you install docker on Ubuntu, if I may ask? I imagine you can run pretty much anything on Ubuntu that you can run on Debian.

Well Ubuntu is based on Debian soooo :wink:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.