I created a new VM instance on my GCE compute engine (I have Owner permissions). On that instance, I installed git, docker, and gcloud - everything is done under sudo su.
I was hoping I can use that VM instance to deploy images to GCR, but whatever I do - I cannot seem to have sufficient permissions to push the images from that instance.
1) I granted "Storage Admin" along with the "Editor" permissions to the VM Instance (autogenerated) IAM service-account.
2) When I run docker login eu.gcr.io I receive Login Succeeded with no problems.
3) I copied both a p12 key and a .json key to the .ssh folder (I generated them on the IAM console) - but that had no use too.
4) To tag and push the docker image, I use this::
docker tag [SOURCE_IMAGE] [HOSTNAME]/[PROJECT-ID]/[IMAGE]
and
docker push [HOSTNAME]/[PROJECT-ID]/[IMAGE]
Notice: It seems that at this stage (2018) gcloud docker -- push is obsolete (and it didn't work for me as well...)
Notice: The bucket is NOT created yet, so setting permissions on the Storage console is out of the question at this point.
What could be the reason for the Permission Denied problem ?
sudo docker push [HOSTNAME]/[PROJECT-ID]/[IMAGE]The permission isssue that you get it not related to the Google cloud.
If you still has the issue past the full screenshot of the error, this will help understand where exactly the issue occur .