Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Image push to google container registry not working

When i push a image from a jenkins to gcr following error occurs: denied: Unable to write blob sha256

Even if i set the registry public it is not possible. The same error occurs

like image 606
Stephan Avatar asked Aug 10 '19 16:08

Stephan


2 Answers

My problem sounded likewise. First, I managed to temporary fix it with @michael-bouvy's solution above, by manual deleting the conflicting images.

What have I done to fix it permanently is adding permission in GC IAM to the appropriate custom role of the identity that performs pushing. Namely, in addition to existing ones:

storage.buckets.get
storage.objects.create
storage.objects.get
storage.objects.list

I appended two more:

storage.objects.delete
storage.objects.update

Basically, these permissions just looked like those that required for temporary manual operations.

like image 60
moudrick Avatar answered Oct 30 '22 19:10

moudrick


I've been facing the same issue, and eventually solved it by removing the problematic Docker image layer, using the Console UI: https://console.cloud.google.com/storage/browser/artifacts..appspot.com/containers/images/

Error message looks like:

denied: Unable to write blob sha256:050eee1aec04cc914bf96e8f4dee7767510c2aca3816af6078ba6fbe3150920e

File name in the artifacts bucket will match exactly the blob name: sha256:050eee1aec04cc914bf96e8f4dee7767510c2aca3816af6078ba6fbe3150920e.

Delete it, and try again. Hope it helps!

like image 41
Michael BOUVY Avatar answered Oct 30 '22 20:10

Michael BOUVY