Cloud Run: image [name] not found even image does exist in container registry - google-cloud-run

I try to run my image on Cloud Run but it said:
yaml:
Anyway my image does exist in the Container Registry
I try to run that container above with specific tag or Digest but it still doesn't work.
Do we have the way to solve this kind of problem?

Related

GitLab Container Registry Not Updating Docker Container Layers

I have a Docker build environment where I build containers locally and test them. When I'm done, I push them to our Dev GitLab container registry to be deployed to Kubernetes.
I've run into a situation where either Docker isn't pushing up the newest layers or GitLab is seeing layers from a previous version and just mounting that layer so when the container is deployed in Kubernetes, the container, despite the new tag, is running the old container image.
I've tried completely wiping my Docker image repository, rebuilding, and repushing and that didn't fix it. I tried using the red trash icon in GitLab to delete the old version of the tag I'm trying to use.
I added some echo's in the console output for the container so I know the new bits aren't being run but I can't figure out if the problem is Docker or GitLab or how to fix it. Anyone have any ideas?
TIA!
Disregard -- my workers had a docker image on them and because my imagePullPolicy in my YAML was not set, it was defaulting to using the cached image in Docker. I just had to clear the image on my worker node (docker rmi -f <image name>) and then I updated my deployment YAML to use an imagePullPolicy: Always.

How to change docker repository for masakari?

hi i am install masakari using kolla-ansible when it try to pull container it throw error `The repository not exist or request denied i check docker hub the image not present there , is there setting in kolla to download the docker image with other name which is present on docker hub.
Global.yml
#kolla_base_distro: "centos"
#kolla_install_type: "binary"
#openstack_release: "ussuri"
Based on your global.yml it should work when you run the following commands to download and rename your prefered docker-images:
docker pull odivlad/masakari:api
docker pull odivlad/masakari:engine
docker pull odivlad/masakari:rc8
docker tag odivlad/masakari:api kolla/centos-binary-masakari-api:ussuri
docker tag odivlad/masakari:engine kolla/centos-binary-masakari-engine:ussuri
docker tag odivlad/masakari:rc8 kolla/centos-binary-masakari-rc8:ussuri
After this the images should match the correct name and should be found by the kolla-ansible run.
I have never used masakari by myself und can not check this in my own kolla-ansible test setup. So it is only a theoretical solution for your problem.

Kubernetes fails to run locally built docker image

I am trying to run a docker image that I have build locally with Kubernetes.
Getting below error
Failed to pull image "myImage": rpc error: code = Unknown desc = Error response from daemon: pull access denied for myImage, repository does not exist or may require 'docker login'
In yaml file i have given as
image: myImage
imagePullPolicy: IfNotPresent
In local i am using docker-desktop and minikube.
I have tried multiple ways but only thing is working on to make tar of myImage and load in minikube.
I have tried using eval $(minikube docker-env) but after this my image is not able to build because it's pulling base image from organization nexus server.
Can anyone suggest anyother way?
Unfortunately I can't comment yet so I have to post an answer. The image you're trying to pull, myImage does not exist in the local image cache of your kubernetes cluster. Running a docker image ls command should yield a list of images that are available locally. If docker doesn't find an image locally, it will (by default) then go to Docker Hub to find the image. Seeing as the image listed has no prefix like someOrganization\ the image is assumed to be an officially published image from DockerHub themselves. Since your locally built image isn't an official Dockerhub image it doesn't know what to run. So the core of the problem is that your minikube doesn't have access to wherever you built your image. Unfortunately I haven't used minikube before so i'm unable to comment on any intricacies of how to work with it. I would be remiss if I left my answer like that, though, so looking at the docs for minikube ( REF: https://minikube.sigs.k8s.io/docs/handbook/pushing/#1-pushing-directly-to-the-in-cluster-docker-daemon-docker-env ) you're doing the right thing with the eval.
Sooo... your minikube isn't stock/vanilla and it pulls from a company repo? Sounds like you need to alter your minikube or you should re-evaluate the base image you're using and fix the Dockerfile.
To fix this, set imagePullPolicy to Never.
Ensure to set eval $(minikube docker-env) before building the image.
Maybe this is a little bit late but... if anyone has the same issue, here is how I solved something like this:
You need to pass "Never" as imagePullPolicy:
imagePullPolicy: Never
You need to load the image inside minikube:
minikube image load myImage
After all this, just continue as usual:
kubectl apply -f whereverTheFileIs.yaml

Tag a Docker image in Google Container Registry with additional tag via command line

I am trying to tag a Docker image sitting in Google Container Registry but am not having any luck. If the image were sitting on my local machine, i could do something like:
docker tag my-image:existing-tag my-image:new-tag
This would result in a second tag for my image. However, in Google Container Registry, I cannot simply use the gcloud wrapper to do so. For example:
gcloud docker -- tag gcr.io/my-project/my-image:existing-tag gcr.io/my-project/my-image:new-tag
This command will not work because even though I am running with gcloud, I get the following response:
Error response from daemon: no such id gcr.io/my-project/my-image:existing-tag
Is what I am attempting possible, and how would one accomplish it?
Just after posting, I discovered I needed to update to the latest gcloud and then could run gcloud container images add-tag. Problem solved.

force refresh of docker image when updated in registry / kubernetes

Using Kubernetes for deployment:
Considering I have a Dockerfile, I build, then push to registry.
If I run a container on a host, the image gets pulled and the container is ran.
Now, if i update the Dockerfile, build and push again, without changing its tag then the image is changed in the registry, but the host has the image pulled, and it doesn't seem to go look for updates.
How do i force a pull to get the latest image when running a container?
I can manually pull the image, but I'd like to know if there is a 'formal way' of doing this (in the pod or rc templates?)
Thanks for insight.
Set an imagePullPolicy of Always on the container

Resources