yodle / docker-registry-client

A Python REST client for the Docker Registry
Apache License 2.0
58 stars 58 forks source link

Wrong digest returned by get_manifest for V2 registry #51

Open Vadiml1024 opened 7 years ago

Vadiml1024 commented 7 years ago

The GET .../repository/manifests/tagname request should be using

Accept: application/vnd.docker.distribution.manifest.v2+json header do get correct manifest and digest

linnil1 commented 6 years ago

Change this.

--- a/docker_registry_client/_BaseClient.py
+++ b/docker_registry_client/_BaseClient.py
@@ -187,7 +187,6 @@ class BaseClientV2(CommonBaseClient):
         self.auth.desired_scope = 'repository:%s:*' % name
         response = self._http_response(
             self.MANIFEST, get, name=name, reference=reference,
-            schema=self.schema_1_signed,
         )
         self._cache_manifest_digest(name, reference, response=response)
         return _Manifest(

Also, Do this code need to change ?

@@ -204,7 +203,7 @@ class BaseClientV2(CommonBaseClient):

         return self._http_call(
             self.MANIFEST, put, data=sign_manifest(content),
-            content_type=self.schema_1_signed, schema=self.schema_1_signed,
+            content_type=self.schema_1_signed,
             name=name, reference=reference,
         )
djmattyg007 commented 3 years ago

Hello. Since this package appears to be abandoned, I forked it to implement various improvements. In particular, I removed support for v1 registries and massively improved support for v2 manifests (including multi-arch manifests).

I'd appreciate it if you could give it a go and let me know how you go:

https://github.com/djmattyg007/dreg-client