Testing with multi-arch Docker images
Testing with multi-arch Docker images With the introduction of Docker Buildx CLI plugin it became quite easy to test various platforms using single Dockerfile without any QEMU static builds. In this tutorial we’re going to use a multistage build with the simple C++ program that tests features of various platforms. First, we need to register QEMU handlers. Please note that the handler registration won’t survive a reboot. $ docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 There is no latest alias for the docker/binfmt and it’s recommended to grab the proper tag on their homepage: https://hub.docker.com/r/docker/binfmt/tags?page=1&ordering=last_updated The code to detect the platform endianness and its sizes for the basic types: #include <iostream> #ifndef PLATFORM #define PLATFORM "N/A" #endif void platform () { std :: cout << "Platform: " << PLATFORM << std ...