K8S on Docker Desktop cannot pull private repo - pull access denied - docker

I have logged in to the Docker hub using the CLI command: docker login. Entered username and password and I can pull and push images to Docker hub.
However, my K8S can't. I am trying to apply a deployment that should pull those images into its pods but I got the following error when running kubectl describe pod POD_NAME:
Warning Failed 9s kubelet Failed to pull image "myprivate/repo:tag": rpc error: code = Unknown desc = Error response from daemon: pull access denied for myprivate/repo, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
How to make the docker run in the pods to also be logged to the docker hub as well as doing it from my terminal?

Create "image pull secret" and define on your deployment. Here is how you can do https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

Related

Unable to pull image from the Gitlab container registry

I have created some images in the Gitlab Container Registry. I am unable to pull them using docker on my local system. The login command succeeds but when I type the following command:
docker pull reg-gitlab-project.company.com/services/palimited/integrationservices/springbootproject/springbootproject:latest
I am getting the following error
Error response from daemon: Head "https://reg-gitlab-project.company.com/v2/services/palimited/integrationservices/springbootproject/springbootproject/manifests/latest": denied: access forbidden
I am unable to figure out why this error is occuring? Can anyone guide me.
You need to authenticate with the container registry at reg-gitlab-project.company.com before issuing a docker pull command.
See, GitLab Docs: Authenticate with the Container Registry.

Error while deploying local python-based docker image on minikube kubernetes cluster

I am trying to deploy a Python flask based application container on minikube locally in an attempt to learn kubernetes. But when I try the below command:
minikube kubectl -- create deployment hello-1 --image=mini-images
I get following error:
Failed to pull image "mini-images": rpc error: code = Unknown desc = Error
response from daemon: pull access denied for mini-images, repository does not
exist or may require 'docker login': denied: requested access to the resource
is denied
I also tried to build the docker image directly following instructions for this page, but the results are same.
What am I doing wrong?
Please consider using the flag "--image-pull-policy" set to "never" when trying to use locally imported images:
minikube kubectl -- create deployment hello-1 --image=mini-images --image-pull-policy='never'

Error response from daemon: pull access denied, repository does not exist or may require ‘docker login

I have made a repository private in Dockerhub.
My repository name is 78124/webapp whch has an image with v1 tag
I have Docker Desktop 2.3.0.2 installed on Windows 10 machine
I do docker login and supply my dockerhub account credentials, I am able to login.
However when I try to pull my private dockerhub repository image with v1 tag using:
docker pull 78124/webapp:v1
I get following error:
Error response from daemon: pull access denied for 78124/webapp, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
I am unable to pull my own private repository.
Thanks.

How to pull from docker hub - pull access denied repository does not exist or may require 'docker login'

I have pulled images from Docker before - some time ago - but now it seems things have changed.
Take for example https://hub.docker.com/r/datagrip. Documentation states installation as follows
docker pull sath89/oracle-xe-11g
This no longer works with current Docker hub. I can try latest
[myuser:~] $ docker pull sath89/oracle-xe-11g
Using default tag: latest
Error response from daemon: pull access denied for sath89/oracle-xe-11g, repository does not exist or may require 'docker login'
Or tag 11.2
[myuser:~] 1 $ docker pull sath89/oracle-xe-11g:11.2
Error response from daemon: pull access denied for sath89/oracle-xe-11g, repository does not exist or may require 'docker login'
Of course I can try login - login succeeds but pulling images is still not working.
[myuser:~] 1 $ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: mydockerhubuser
Password:
WARNING! Your password will be stored unencrypted in /home/myuser/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[myuser:~] $ docker pull sath89/oracle-xe-11g:11.2
Error response from daemon: pull access denied for sath89/oracle-xe-11g, repository does not exist or may require 'docker login'
[myuser:~] 1 $
What is the secret nowadays for pulling images from Docker hub? It used to be so easy. Too easy clearly.

Creating tag for image pushing to repository

I have created repository in docker cloud andrejvi/andrejvi_repo and would like to place there image I have created.
Image name is dev_centos32
I do push:
sudo docker push andrejvi/dev_centos32
According to my understanding I must create tag for this image. How to do that?
Trying to push:
sudo docker push andrejvi/andrejvi_repo:dev_centos32
got error:
An image does not exist locally with the tag: andrejvi/andrejvi_repo:
UPD
I changed tag, but still can't push to repository
docker tag dev_centos32 andrejvi/andrejvi_repo/dev_centos32
sudo docker push andrejvi/andrejvi_repo/dev_centos32
The push refers to repository [docker.io/andrejvi/andrejvi_repo/dev_centos32]
0afb6e2f03f2: Preparing
d70d6ed6bc21: Preparing
denied: requested access to the resource is denied
UPD
Got error while login
$ sudo docker login andrejvi
Username: andrejvi
Password:
Error response from daemon: Get https://andrejvi/v2/: dial tcp: lookup andrejvi on 127.0.1.1:53: server misbehaving
denied: requested access to the resource is denied
You need to login into Docker Hub/Docker Cloud repository using the command:
docker login
Take a look at Push images to Docker Cloud.
Try:
docker login
docker tag dev_centos32 {docker-hub-username}/andrejvi/andrejvi_repo/dev_centos32
docker image push {docker-hub-username}/andrejvi/andrejvi_repo/dev_centos32

Resources