Skip to content

Commit 86298dc

Browse files
committed
fix: When pushing images to registry cache, use image-manifest=true
Without this change, when building images with --cache-to-registry, BuildKit uses a proprietary cache artifact format, which breaks when using third-party registries such as Harbor. By adding the image-manifest=true option, BuildKit uses a standard cache artifact format that is compatible with all registries. See goharbor/harbor#18941 for background information.
1 parent a666732 commit 86298dc

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- [Improvement] When building images with `tutor images build
2+
--cache-to-registry`, use a cache artifact format that is
3+
universally compatible with all registries. This enables the use of
4+
that option when working with third-party registries such as
5+
[Harbor](https://goharbor.io/).

tutor/commands/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def build(
227227
image_build_args.append(f"--cache-from=type=registry,ref={tag}-cache")
228228
if cache_to_registry:
229229
image_build_args.append(
230-
f"--cache-to=type=registry,mode=max,ref={tag}-cache"
230+
f"--cache-to=type=registry,mode=max,ref={tag}-cache,image-manifest=true"
231231
)
232232

233233
# Build contexts

0 commit comments

Comments
 (0)