This updates the Dockerfile to support multi architecture image
builds (amd64, arm64 and armv7), and adds some automation to build
them in parallel and stitch them together into a single multi-arch
image.
This helps to remove "false" deps on things like openssl; now that
is linked in only to those components that need it (eg: things that
use unbound for dnssec, or the smtp client for DANE).
This makes the binaries other than kumod (which still has max deps)
a few MB smaller; not a massive win, but nice all the same.
This uses alpine to build and the docker scratch image for installation,
resulting in an image of 150MB in size, compared to the 251MB size of
our current ubuntu based image.
I think we can shrink things down a bit more; for example, the kcli
utility pulls in the message crate for some of its types, but ends up
linking in openssl and other deps. Splitting out the types into a
message-types crate might help to reduce the size of that executable.
Similarly, the other executables seem to have more stuff linked in
than is strictly needed.
In the future I want to add separate packages for just the proxy
server, but for now this is the most expedient way to deliver
the binary.
refs: https://github.com/KumoCorp/kumomta/issues/45
```console
$ kcli --help
KumoMTA CLI.
Full docs available at: <https://docs.kumomta.com>
Usage: kcli --endpoint <ENDPOINT> <COMMAND>
Commands:
bounce
Administratively bounce messages in matching queues
set-log-filter
Changes the diagnostic log filter
help
Print this message or the help of the given subcommand(s)
Options:
--endpoint <ENDPOINT>
URL to reach the KumoMTA HTTP API
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
```
```console
$ kcli bounce --help
Administratively bounce messages in matching queues.
Each individual message that is bounced will generate a log record capturing the event and then be removed from the spool.
Make sure that you mean it, as there is no going back!
The bounce will be applied immediately to queued messages, and the directive will remain in effect for the duration specified, causing newly received messages or messages that were in a transient state at the time the directive was received, to also be bounced as they are placed back into the matching queue(s).
Usage: kcli --endpoint <ENDPOINT> bounce [OPTIONS] --reason <REASON>
Options:
--domain <DOMAIN>
The domain name to match. If omitted, any domains will match!
--campaign <CAMPAIGN>
The campaign name to match. If omitted, any campaigns will match!
--tenant <TENANT>
The tenant name to match. If omitted, any tenant will match!
--reason <REASON>
The reason to log in the delivery logs
--everything
Purge all queues
--duration <DURATION>
The duration over which matching messages will continue to bounce. The default is '5m'
-h, --help
Print help (see a summary with '-h')
```
```console
$ kcli set-log-filter --help
Changes the diagnostic log filter
See <https://docs.kumomta.com/reference/kumo/set_diagnostic_log_filter/> for more information about the log filter syntax.
Usage: kcli --endpoint <ENDPOINT> set-log-filter <FILTER>
Arguments:
<FILTER>
Options:
-h, --help Print help
```
refs: https://github.com/KumoCorp/kumomta/issues/55
Revert building static/bundled sqlite, as the logic deep in sqlite3-src
makes no attempt to deal with this mess on centos7:
= note: /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /__w/kumomta/kumomta/target/release/deps/libsqlite3_src-b3c44e6f34aac065.rlib(sqlite3.o):(.data.rel.aSyscall+0xb0): undefined reference to `fcntl64'
collect2: error: ld returned 1 exit status
(I don't blame it!)
Deal with that in the docker image by simply installing sqlite
in the docker image.
And since I'm touching the docker stuff, adjust its install
path and layout to match that of the rpm and deb packages.
A downside of pulling in rocksdb is that it is a pretty big
C++ library and musl/alpine don't really get on with it.
Switch to using the latest ubuntu LTS image as our base.