The docker build was clearly successful as the docker image exists, but docker push keeps failing:
Why? And how do I fix it?
I also tried replacing the project name with the project ID from the dashboard as shown in the screenshot of the terminal, but to no avail.
I have already done gcloud auth configure-docker
before.
EDIT: After tagging the docker image appropriately, and then trying to push it, I still get the same error:
Showing two runs, the latter with project ID in the name. It gives error too.
2
Answers
Ok, I got it working now. The build command needs to be changed, the guide I was following seems to be outdated now.
So in the guide I was following, the
gcr.io
was given in build command itself like so:But now, the solution is to build it normally, without the
gcr.io
, like so:And then, like the previous answerer says, we need to tag it appropriately as documented in Google's official guide:
The
insurance-pycaret-demo:v1
part is any name you choose to give the new image.After that,
docker push gcr.io/endless-ability-365318/insurance-pycaret-demo:v1
works.First change your image name to the gcr.io/<your_project_id>/insurance_app:v1.
For that use following command.
Then use again following command
Because before push to the docker google cloud docker registry you have to format the image name using registry name and project id.