Search code examples
gcloud

GCR Cloud Run says "Image [name] not found"


I'm trying to take my first baby steps with podman (instead of Docker) and Google Cloud Run. I've managed to build an image with a gcr.io tag and push it to Google. I then create a new service, and I can select the image in the "Select Image URL" pop-up dialog. But then the service fails to start, saying "Image [full name] not found".

I can't find anything on Google's support pages, or anywhere else. I can pull the image, I can push new versions, and they appear on the pop-up dialog. But the service still reports that they can't be found.

What am I doing wrong?

Edit in answer to DazWilkin's questions below:

Can you run the podman-created container locally using Docker?

I can't run Docker locally because it is not compatible with Fedora 31 (hence podman). But I can run it locally using podman run

Can you deploy a Docker-created container in Cloud Run?

As above: F31. However podman is supposed to be a drop-in replacement.

Is the container registry in the same project as Cloud Run?

Yes. I did have a problem with that, but I got a permissions message rather than "not found".

Have you tried deploying via gcloud rather than the console?

Yes.

$ podman push eu.gcr.io/my-project/hs-hello-world
Getting image source signatures
Copying blob c7f3d2e0289b done  
Copying blob def7032cea8e done  
Copying config f1c2e2615f done  
Writing manifest to image destination
Storing signatures

$ gcloud run deploy --image eu.gcr.io/my-project/hs-hello-world --platform managed
Service name (hs-hello-world):  
Deploying container to Cloud Run service [hs-hello-world] in project [my-project] region [europe-west1]
X Deploying... Image 'eu.gcr.io/my-project/hs-hello-world' not found.                     
  X Creating Revision... Image 'eu.gcr.io/my-project/hs-hello-world' not found.           
  . Routing traffic...                                                                             
Deployment failed                                                                                  
ERROR: (gcloud.run.deploy) Image 'eu.gcr.io/my-project/hs-hello-world' not found.

When I used a Google-built container it worked fine.

Update: 5 March 2020

In the end I just carried on with the Google build service, and it works fine. My initial wish for local builds was in large part because a build on Google was taking over half an hour (lots of Haskell libraries to import), but now I've figured out how to use staged builds and multi-processor VMs to avoid this. I appreciate the efforts of those who have tried to help, but right now it's not broke so I'm not going to try to fix it.


Solution

  • I had the same issue: it seems Cloud Run is picky about the kind of manifest it can pull.

    By building my images with --format docker and pushing them with --remove-signatures (inspired by this issue), podman will create and push docker-style manifests to the Container Registry and everything ran smoothly!

    Too bad I spent a lot of time thinking it was a lack of permissions problem