Преглед на файлове

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>
Tianon Gravi преди 2 години
родител
ревизия
1741771b67
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      daemon/containerd/cache.go

+ 6 - 0
daemon/containerd/cache.go

@@ -31,6 +31,12 @@ type imageCache struct {
 
 func (ic *imageCache) GetCache(parentID string, cfg *container.Config) (imageID string, err error) {
 	ctx := context.TODO()
+
+	if parentID == "" {
+		// TODO handle "parentless" image cache lookups ("FROM scratch")
+		return "", nil
+	}
+
 	parent, err := ic.c.GetImage(ctx, parentID, imagetype.GetImageOpts{})
 	if err != nil {
 		return "", err