Multi-Arch, Single Dockerfile
This section describes the learnings from StorPerf working on the container decomposition intern project. The goal was to use a single Dockerfile to create images that can build any architecture supported by the multiarch/alpine docker repository. The currently validated list from multiarch/alpine is:
Linux 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 aarch64 Linux
|64 bit ARM (compatible with ENEA and ARMband pods)|
|armhf||Linux 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 armv7l Linux||Hard floating point. Should work for Raspberry PIs|
|x86_64||Linux 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 Linux||64 bit Generic x86 chip. (Compatible with x86 64 bit based pods)|
For StorPerf, we are only supporting aarch64 and x86_64.
The dockerfile is broken down as follows:
The first line creates a default ARCH variable in case one is not specified. This was required as part of the general Jenkins build procedure so as not to introduce a hard requirement for all projects to support an ARCH build arg.
The FROM line allows for changing of the build architecture as needed.
Once the resulting image is created, it gets pushed to Docker Hub as: opnfv/project-name:arch-version. So for the StorPerf HTTP Frontend container for Euphrates on ARM would be: