diff --git a/copy/copy.go b/copy/copy.go index 9bc479d23..11d82ad72 100644 --- a/copy/copy.go +++ b/copy/copy.go @@ -1620,6 +1620,7 @@ func (c *copier) copyBlobFromStream(ctx context.Context, srcStream io.Reader, sr finalizer = fin inputInfo.Digest = "" inputInfo.Size = -1 + inputInfo.CryptoOperation = types.Encrypt encrypted = true } } diff --git a/docker/docker_image_dest.go b/docker/docker_image_dest.go index 84694e157..bf84d6a5c 100644 --- a/docker/docker_image_dest.go +++ b/docker/docker_image_dest.go @@ -205,7 +205,9 @@ func (d *dockerImageDestination) PutBlob(ctx context.Context, stream io.Reader, } logrus.Debugf("Upload of layer %s complete", computedDigest) - cache.RecordKnownLocation(d.ref.Transport(), bicTransportScope(d.ref), computedDigest, newBICLocationReference(d.ref)) + if inputInfo.CryptoOperation != types.Encrypt { + cache.RecordKnownLocation(d.ref.Transport(), bicTransportScope(d.ref), computedDigest, newBICLocationReference(d.ref)) + } return types.BlobInfo{Digest: computedDigest, Size: sizeCounter.size}, nil }