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.
- I granted "Storage Admin" along with the "Editor" permissions to the VM Instance (autogenerated) IAM service-account.
- When I run
docker login eu.gcr.io
I receiveLogin Succeeded
with no problems. - 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.
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 ?