Skip to content

Commit 1741771

Browse files
committed
Skip cache lookup for "FROM scratch" in containerd
Ideally, this should actually do a lookup across images that have no parent, but I wasn't 100% sure how to accomplish that so I opted for the smaller change of having `FROM scratch` builds not be cached for now. Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
1 parent 8805e38 commit 1741771

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

daemon/containerd/cache.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ type imageCache struct {
3131

3232
func (ic *imageCache) GetCache(parentID string, cfg *container.Config) (imageID string, err error) {
3333
ctx := context.TODO()
34+
35+
if parentID == "" {
36+
// TODO handle "parentless" image cache lookups ("FROM scratch")
37+
return "", nil
38+
}
39+
3440
parent, err := ic.c.GetImage(ctx, parentID, imagetype.GetImageOpts{})
3541
if err != nil {
3642
return "", err

0 commit comments

Comments
 (0)