Kubernetes cannot pull image from private docker image repository

后端 未结 7 1198
Happy的楠姐
Happy的楠姐 2020-12-17 08:22

I have problem with kubernetes (minikube) and pull images from local image repository on docker. Docker repository was created:

docker run --entrypoint htpas         


        
7条回答
  •  盖世英雄少女心
    2020-12-17 09:09

    When you run Kubernetes in Docker for Desktop your applications will share the same image registry across Docker and Kubernetes. List od all images:

    docker images --all
    

    Choose of them and run it with changed atribute --image-pull-policy=Never. For example:

    kubectl run ContainerName --image=myimage/server --port=8080 --image-pull-policy=Never 
    

    By default, the kubelet will try to pull each image from the specified registry. However, if the imagePullPolicy property of the container is set to IfNotPresent or Never, then a local image is used (preferentially or exclusively, respectively). Link

    It's mean, that Kubernetes pull image from local registry, not remote cloud.

提交回复
热议问题