ibaigmr
03/11/2025, 9:59 PMAnswer Overflow
03/11/2025, 9:59 PMgmpinder
03/11/2025, 10:11 PMrobert_83982
04/18/2025, 8:32 AM--layers --cache-from ⦠--cache-to. Man here: https://manpages.ubuntu.com/manpages/plucky/man1/buildah-build.1.html
With Gitlab CI, this could look like:
podman build -t container-name:$VERSION --layers --cache-to $CI_REGISTRY_IMAGE/cache-image --cache-from $CI_REGISTRY_IMAGE/cache-image -f Containerfile . The cache-image could possibly made configurable.
@gmpinder I did not find the issue in the cli repo. If you tell me where it is, I can also add this info to the issue (and track the issue myself). šgmpinder
04/18/2025, 11:33 AMLuci
04/19/2025, 5:14 AMrobert_83982
04/20/2025, 4:59 PMgmpinder
04/20/2025, 5:27 PMibaigmr
04/26/2025, 10:18 PMbash
docker buildx build --push -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA \
--cache-to type=registry,ref=$CI_REGISTRY_IMAGE/cache-image,mode=max \
--cache-from type=registry,ref=$CI_REGISTRY_IMAGE/cache-image .
I think we should follow a similar approach to BB_BUILDKIT_CACHE_GHA to support this caching mechanism by adding another if statement in the build_tag_push function in docker_drivers.rs. What do you all think?gmpinder
04/26/2025, 11:44 PMibaigmr
05/12/2025, 8:34 AMBB_CACHE_LAYERS environment variable.
Thank you, @gmpinder, for your excellent work!gmpinder
05/12/2025, 11:03 AMgmpinder
05/12/2025, 11:03 AMrobert_83982
06/01/2025, 6:09 PMBB_CACHE_LAYERS: true in my variables dictionary in the gitlab-ci yaml file, but I get now the error: "invalid reference format"gmpinder
06/01/2025, 6:09 PMgmpinder
06/01/2025, 6:09 PM"true"gmpinder
06/01/2025, 6:10 PMrobert_83982
06/01/2025, 6:19 PMgmpinder
06/01/2025, 6:19 PM/ with _ for tags?gmpinder
06/01/2025, 6:20 PMgmpinder
06/01/2025, 6:20 PMrobert_83982
06/01/2025, 6:21 PMrobert_83982
06/01/2025, 6:21 PMgmpinder
06/01/2025, 6:21 PMgmpinder
06/01/2025, 6:22 PMgmpinder
06/01/2025, 6:22 PM/ is not allowed in a tagrobert_83982
06/01/2025, 6:23 PMgmpinder
06/01/2025, 6:23 PMgmpinder
06/01/2025, 6:32 PMgmpinder
06/01/2025, 6:32 PMgmpinder
06/01/2025, 6:40 PMgmpinder
06/01/2025, 7:37 PMgmpinder
06/01/2025, 7:37 PMrobert_83982
11/09/2025, 4:57 PMgmpinder
11/09/2025, 5:02 PMgmpinder
11/09/2025, 5:05 PMrust
let image: Reference = format!("{image_name}:{}", tags.first().map_or("latest", |tag| tag))
.parse()
.into_diagnostic()?;
let cache_image = (self.cache_layers && self.push).then(|| {
let cache_image = Reference::with_tag(
image.registry().to_string(),
image.repository().to_string(),
format!(
"{}-cache",
image.tag().expect("Reference should be built with tag")
),
);
debug!("Using {cache_image} for caching layers");
cache_image
});gmpinder
11/09/2025, 5:07 PMrobert_83982
11/09/2025, 6:29 PMalt-tags, it will use the first one in the list and add -cache? If so, I suggest to mention this logic somewhere.