Enable multi-platform image builds with docker buildx
Given PR propose an alternative build back-end that allow multi-platform build & test of LAVA docker images.
Major changes/improvements:
-
aarch64&arm64merged to a singledockerfilesdirectories following below structure:dockerfiles/ └── <IMAGE_NAME> ├── flavor-a.Dockerfile ├── flavor-b.Dockerfile └── test.sh # Dockerfiles are still created from Jinja2 templates extending base.jinja2 share/templates/ └── <IMAGE_NAME> ├── flavor-a.Dockerfile.jinja2 └── flavor-b.Dockerfile.jina2- Files (eg: test.sh) are no longer duplicated in every platform/debian version.
- Dependencies are identical not matter the platform, such as tests
- Multi-stage
base.jinja2build -> test -> final-
build: legacybase.jinja2including few optimizations related to cache. -
test: new Executetests.shand store logs in/var/log/ci_tests.log -
final: new Create the final image fromscratchand copy rootfs frombuild(single layer image)
Note: tests logs are included infinalto keep a dependency onteststage (ensure test execution during image build)
- Add
docker-bake.hcl- Replacement for
build.sh - Store all available targets
- Replacement for
- Add
Makefile: used in gitlab-ci, act as shortcut for few actions on the project - Gitlab-CI
- Build all images for all supported platform (excluding
analyzewhich remainsamd64only) - Add final stage creating multi-platform manifests
- Change runner to
saas-linux-small-arm64for arm64 jobs.mediumis only available with paid versions of gitlab.
- Build all images for all supported platform (excluding
-
Container Registry
- Naming convention changed to limit the number of docker repositories
- Flavors are platforms are specified in tags
- Service set the repository name
- Platform specific tag:
ci-image/dispatcher:debian-12-arm64 - Multi-platform tag:
ci-image/dispatcher:debian-12
Screenshots from registry:
Signed-off-by: Thomas Mahé thomas.mahe@nxp.com
Edited by Mahe Thomas

