mailarchiver in docker-container, any one?

248 views
Skip to first unread message

datenheim

unread,
Aug 22, 2019, 2:14:55 AM8/22/19
to MailArchiva
Hi,

I'm trying to get mailarchiva running as a docker container - without success so far.

Is there any official manual for running in docker? Any inofficial?

There are a few documented attemps which are either rather old or no longer working:
Has anybody got the latest mailarchiva running in docker and is willing to
share Dockerfiles and/or Compose files or any further information?

I recently worked on the tcs-example from above but got stuck at getting
mailarchiva starting in the container. It always starts tomcat once and then
exits immediately without useful hints why.

Regards, dh

David Masters

unread,
Dec 10, 2020, 4:55:44 AM12/10/20
to MailArchiva
Hi DH,

I'm experiencing the same issue - did you ever manage to resolve this?

Regards
David

datenheim

unread,
Dec 22, 2020, 12:54:00 PM12/22/20
to MailArchiva
Nothing for productive work actually.
Support has never answered except "buy a licence then we may eventually tell something about that".

Jamie

unread,
Dec 22, 2020, 1:58:53 PM12/22/20
to MailArchiva
Datenheim, I don't believe we've ever said buy a license and we will tell you about docker. I think you're just trying to get a reaction from us, because you're not finding the info you need.  Let me assist you - we don't offer a docker image, and don't see the point of offering one. Just download the tar file and run the setup. It is that simple. There is no complexity there.

Jamie

unread,
Dec 22, 2020, 2:02:20 PM12/22/20
to MailArchiva
I'm all ears if you would care to explain why you feel docker support is important. To me docker is useful in situations where you have complex deployments that need to be reproduced. MailArchiva is not a complex deployment. It is a single setup, just run it and the product is installed.

jamie

unread,
Dec 22, 2020, 2:41:05 PM12/22/20
to MailArchiva
In terms of actually getting MailArchiva working in docker, unfortunately, I have very limited experience with docker. I don't expect it would be very hard to get it running in docker. MailArchiva is just a regular web app running Apache Tomcat with CATALINA_BASE pointed to /var/opt/mailarchiva/tomcat/webapps. So I guess the Docker image would be similar to https://hub.docker.com/_/tomcat. MailArchiva runs under Apache Tomcat 7.x, with AdoptJDK JRE v8 update 221. The server startup scripts, etc are pretty standard. When MailArchiva starts, it outputs the startup logs in /var/opt/mailarchiva/tomcat/logs. Just check the log files in that location to see the reason why the server wont start.9/10 the server wont start due to a memory issue. Either too much or too little heap allocated. Furthermore, Tomcat obviously wont start if it can't find the program files in /var/opt/mailarchiva/tomcat/webapps/ROOT. Furthermore, if you are running Oracle JDK, then you may need to install JRE v8 with cryptographic extensions installed. I hope the above information helps. Any case, I'd still like to understand why the attraction to docker in the MailArchiva context. What am I missing here?

On Tuesday, December 22, 2020 at 7:54:00 PM UTC+2 datenheim wrote:

datenheim

unread,
Dec 22, 2020, 3:43:55 PM12/22/20
to MailArchiva
Hi Jamie,
of course I tried to get a response from you ;)

Q) Why would be a working docker image / docker-compose example the attractive?
A) Let's compare it with for instance Nextcloud installation. That requires a webserver, a database and of course some storage. For sure, mariadb is simple to install directly as is Nextcloud. But in terms of "transportability" from one server to another, or in terms of low level backup, there is a difference. With a proper docker-compose installation making a backup of everything, including every bit of configuration, data etc. it is just a "docker-compose down" and afterwards doing a tar of a single folder.
Bringing this complete installation to another computer, a replaced server etc. is just unpacking the tar and saying "docker-compose up -d" and it is running again.
To update Nextcloud it only takes changing the version number in the compose file an then again docker-compose down / up -d. To take a snapshot one could use docker-compose stop (or pause), make the snapshot (quite fast with zfs) and afterwards compose start (or resume). That's it.

All requirements such as JRE and tomcat and the files of mailarchiva are tied together in one place (the docker image) reducing the number of decisions and chances of misconfiguration of those components.

Supporting/providing examples of a dockerized mailarchiva could IMHO give it a boost in sales.

Thomas Goetten

unread,
May 18, 2022, 3:03:35 PM5/18/22
to MailArchiva
Hi,

I know it's an old thread that hasn't been active for almost 2 years.

I found this discussion while I was looking for a ready-to-go dockerized Mailarchiva template.
After I failed to get the three already existing projects to run, I realized I had to come up with an ready-to-go dockerized Mailarchiva template.


Feedback is always appreciated!

Thomas
Message has been deleted

jamie

unread,
May 19, 2022, 2:24:02 AM5/19/22
to MailArchiva
Thomas. Thank you so much for your generous contribution. I will give it a try soon. I noticed your Dockerfile has  v8.7.15 hard coded. I don't know much about Docker config, but is there anyway this version can be fed in as a parameter so that it will work with all versions of MailArchiva? For further improvement I would suggest to install MariaDB as an externalized database. See:  Externalize SQL database (mailarchiva.com), and install Orient DB as a separate process  Externalize graph database (mailarchiva.com). Furthermore, to front MailArchiva with Nginx. See:  Nginx (mailarchiva.com). This is a truly  professional setup, as these databases ought to be run as separate processes.

datenheim

unread,
May 19, 2022, 8:56:21 AM5/19/22
to MailArchiva
Hello Thomas,
thank you for taking a lead here! Will fire a test soon.

@jamie: If there is a static download URL always pointing to the latest war file that could be easily added in the Dockerfile.

Right now that is not possible (without additional fiddling and scraping) because ADD in the Dockerfile requires the correct URL and does not really allow variables, afaik.
An FTP might also do, where you can put a symlink always pointing to the latest release.

datenheim

unread,
May 19, 2022, 9:30:05 AM5/19/22
to MailArchiva
On the other hand having a "latest"-URL may cause some trouble during updating,
if there are breaking changes that need special intervention on a already running instance.

Jamie

unread,
Aug 13, 2022, 8:50:24 AM8/13/22
to MailArchiva
Hello

We have added a latest URL function to our download center.


The first Get latest command above will return a JSON like this.

{
  "productId": "MAONPREM",
  "productName": "MailArchiva On Premise",
  "version": "8.10.1",
  "changeLog": "<p style=\"color: rgb(115, 115, 115); text-align: start;\">[AR-2744] - PKCS11, PKCS8, PEM and JKS certificate/key import\n<br>[AR-2734] - show messages as read (see user preferences)\n<br>[AR-2745] - internal proxy for office 365 folder sync traffic<br>[AR-2743] - forward route includes system blob headers<br>[AR-2737] - datatables move from array to json data representation</p>",
  "distributions": [
    {
      "publishDate": "2022-08-12T08:15:00",
      "downloadUrl": "https://stimulussoft.b-cdn.net/mailarchiva_server_linux_v8.10.1.tar.gz",
      "sha256Hash": "c78b31c5be4034f2681a50e69ce33c64ca838bd8a51987e4b949a91d3f7dc296",
      "operatingSystem": "LINUX",
      "fileSize": 336962861
    },
    {
      "publishDate": "2022-08-12T08:15:00",
      "downloadUrl": "https://stimulussoft.b-cdn.net/mailarchiva_server_windows_v8.10.1.zip",
      "sha256Hash": "f6839c0d06bb3faf818fcb8196d27be0430efe0c3c7ebeeef2d4ed95d6c9bddd",
      "operatingSystem": "WINDOWS",
      "fileSize": 301371066
    },
    {
      "publishDate": "2022-08-12T11:54:00",
      "downloadUrl": "https://stimulussoft.b-cdn.net/mailarchiva_v8.10.1.war",
      "sha256Hash": "",
      "operatingSystem": "WAR",
      "fileSize": 287293452
    }
  ]
}

Parse the JSON result to obtain the download URL for the file.


Jamie

unread,
Aug 13, 2022, 8:51:36 AM8/13/22
to MailArchiva
You can also use https://stimulussoft.com/rss/product/maonprem to get the latest updates via RSS feed for MailArchiva On-Premise.

Jamie

unread,
Aug 13, 2022, 9:06:57 AM8/13/22
to MailArchiva
To get the latest WAR .. 


To upgrade,  remove the /var/opt/mailarchiva/tomcat/webapps/ROOT and unpack the WAR file into that directory.

Johnny Moore

unread,
Sep 21, 2022, 7:59:55 PM9/21/22
to MailArchiva
You mentioned connecting to mysql for the database, I'm assuming to replace h2,.
The links you've posted are invalid and I'm unable to find configuration for this in the system files nor help.mailarchiva.com.

The same goes for Orient, I don't see any configuration values to point to an external server.

Johnny Moore

unread,
Sep 22, 2022, 4:51:57 PM9/22/22
to MailArchiva
I've published my local container config to Docker Hub.
See the GitHub source for using it with Nginx, Caddy, or Traefik.
You can also run this version on amd64 and arm64.
I've got it running in AWS on Graviton2 behind an EC2 loadbalancer.

Docker Hub: https://hub.docker.com/r/jokneemo/mailarchiva
GitHub (source): https://github.com/JoKneeMo/mailarchiva-docker

The links you've posted for grabbing the latest versions require authentication. However, getting the latest version for building a docker image doesn't make much sense because of version control.

If you are able to point me at information to preconfigure remote database connections and ClamAV it would be very helpful.
I would like run those as separate containers in a cluster if possible.

jamie

unread,
Oct 3, 2022, 5:52:50 AM10/3/22
to MailArchiva
Sorry John. Those update URL's were changed at the last minute. They need an extra /api/v1 prepended


I suggest to use 3) above to get the latest version of v8 for the docker container. The reason being, MailArchiva V8 will rely on Tomcat 9 + JRE 8. This isn't going to change. Thus, it should be safe to unpack the WAR into /var/opt/mailarchiva/tomcat/webapps/ROOT/. 

See http://multitenant.mailarchiva.com/graphdb for info on how to externalize graph DB and http://multitenant.mailarchiva.com/mariadb for info on how to externalize SQL DB (using MariaDB 10.6). 






jamie

unread,
Oct 3, 2022, 5:55:28 AM10/3/22
to MailArchiva
The return value for the command:

wget "https://stimulussoft.com/api/v1/download/product/maonprem/latestwithin?lowerVersion=8.0.0&upperVersion=8.99.99"  

will be something like:

{
  "productId": "MAONPREM",
  "productName": "MailArchiva On Premise",
  "version": "8.11.11",
  "changeLog": "<p>[AR-2773] - NPE when build TransmitMessage on QueueTransmit<br>[AR-2775] - multitenant: cannot view app process log from central<br>[AR-2776] - pst export: some messages with&nbsp;KOI8-R body text are&nbsp;garbled<br>[AR-2777] - Migrate ODB users to Hibernate email address javax.validation.ConstraintViolationException<br><br></p>",
  "distributions": [
    {
      "publishDate": "2022-10-03T08:36:00",
      "downloadUrl": "https://stimulussoft.b-cdn.net/mailarchiva_server_linux_v8.11.11.tar.gz",
      "sha256Hash": "fa3b8cddb65d09f2c6d2069726f37488e9964091b80a28d13a1609eeb1975f66",
      "operatingSystem": "LINUX",
      "fileSize": 340179289
    },
    {
      "publishDate": "2022-10-03T08:36:00",
      "downloadUrl": "https://stimulussoft.b-cdn.net/mailarchiva_v8.11.11.war",
      "sha256Hash": "a0b42996b9b09d68d197050aace6efd1260f23326ba8be559cd2e958910631bb",
      "operatingSystem": "WAR",
      "fileSize": 287247078
    },
    {
      "publishDate": "2022-10-03T08:36:00",
      "downloadUrl": "https://stimulussoft.b-cdn.net/mailarchiva_server_windows_v8.11.11.zip",
      "sha256Hash": "b97c4bf601058c830d1bb90f6b609d225ae9fe7cb8fd6ca4bf0381d98eda257f",
      "operatingSystem": "WINDOWS",
      "fileSize": 329478975
    }
  ]
}


jamie

unread,
Oct 3, 2022, 6:00:06 AM10/3/22
to MailArchiva
We also aim not to break compatibiltiy with MailArchiva V8 and third party components such as MariaDB, Orient DB. Thus, it should be safe to include update to V8 as part of your Docker container.

jamie

unread,
Oct 3, 2022, 6:14:38 AM10/3/22
to MailArchiva
FYI:  in the Orient DB & MariaDB externalize instructions, where it refers to "/etc/opt/mailarchiva/central" use "/etc/opt/mailarchiva/ROOT"

jamie

unread,
Oct 3, 2022, 6:17:34 AM10/3/22
to MailArchiva
FYI: In 8.11 we upgraded Tomcat 7 to Tomcat 9. There are slight changes to Tomcat's server.xml described at https://help.mailarchiva.com/upgradeissues 

jamie

unread,
Oct 3, 2022, 6:51:29 AM10/3/22
to MailArchiva
Whoops! Another slight issue.  Should prepend server with "bs."   Please use these URL's rather


On Monday, October 3, 2022 at 11:52:50 AM UTC+2 jamie wrote:

jamie

unread,
Feb 1, 2023, 4:14:29 AM (7 days ago) Feb 1
to MailArchiva
You could incorporate these commands into the Docker image to ensure that the software is the latest

Install the latest on Linux

curl https://bs.stimulussoft.com/api/v1/download/product/maonprem/linux/latest | grep -oP '"downloadUrl": *"K[^"]*' | xargs curl | tar -xz -C /tmp && cd /tmp/mailarchiva_dist* && ./install

Upgrade to Latest on Linux (via WAR file update)

curl https://bs.stimulussoft.com/api/v1/download/product/maonprem/latest | grep -oP '"downloadUrl": *"K[^"]*' | xargs curl -o /var/opt/mailarchiva/tomcat/webapps/ROOT.war


Reply all
Reply to author
Forward
0 new messages