Skip to content

Implement buildah caching for faster image builds

Aayush Raj requested to merge 44yu5h/salsa-ci:buildah-cache into master

This commit enables buildah caching to reduce the build times down to mere 2 to 3 minutes for forked repositories while ensuring the main repository (salsa-ci-team/pipeline) always builds fresh images.

The BUILDAH_ENABLE_CACHE flag can be used to toggle cache usage when starting a new pipeline from the web. Additionally, CACHE_TO_ARG and CACHE_FROM_ARG allow overriding the default cache behaviour, if need be.

Container image names are limited to 2 levels deep due to GitLab registry constraints. To work around this, caches are named as: /cache/${ARCH_NAMESPACE//\//-}${IMAGE_NAME} (Examples: cache/base, cache/arm32v7-base, etc.)

Merge request reports

Loading