Rework Docker image builds

Build three images, based on Debian, Alpine, and distroless.

This MR replaces:

This MR is written with !139 (merged) in mind. The three Dockerfile download the release ZIP from packages.fmd-foss.org, unzip it, and copy the binary relevant for the target arch.

This code builds 3 images. All of them are multi-platform, for 3 archs (amd64, arm, arm64). The three images are tagged as follows:

  • 0-alpine, 0.12.0-alpine
  • 0-distroless, 0.12.0-distroless
  • 0, 0-debian, 0.12.0, 0.12.0-debian

With this MR we no longer have a :latest tag. This is intentionally, I strongly believe that people should pin a major version instead. (I once broke my MySQL database because I used :latest, and then :latest moved from :5.7 to :8.)

Faster image builds

Importantly, this heavily speeds up the Docker image build. We'll have to see how fast it is in the CI. However, by using pre-built binaries, the build process is much faster. I'm hoping it to be < 10 minutes, let's see. Even though we build two new image types!

Testing

Test this with:

./docker/build_images.sh v0.12.0

Until we have pre-built multi-arch packages (see !139 (merged)), you need to remove the -${TARGETARCH} suffix from the respective lines in the 3 Dockerfiles.

Additionally, to cross-compile, see the docker/README.md for the necessary setup.

I did some minimal testing for all 3 images on amd64 as follows: build them locally, check that they start, that I can register, and that I can send commands to my phone (i.e. push and CA certificates work).

Documentation

I'm planning to update the documentation in a separate MR. This might be a good time to start moving some of the docs to Docusaurus (fmd-foss.org).

Merge request reports

Loading