1

I want to check if a specific layer exists in my private Docker registry. To do that I will check if a blob exists with: HEAD /v2/<name>/blobs/<digest>.

My problem is find the layer digest. I've already tried with layer.DiffID [calculated with DiffID = SHA256hex(uncompressed layer tar data)], but is not work because DiffID is not the layer digest.

Anyone know how to calculate/generate the layer digest?

1 Answer 1

1

Layer_Digest is calculated with the sha256sum(compressed_layer) and...

compressed_layer=gzip.NewWriter(uncompressed_layer).

To get the compressed layer you need to use the GOlang gzip implementation. Only GOlang gzip returns the compressed layer correctly and with this compressed layer it is already possible to generate the digest that is present in the registry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.