Kubernetes cannot pull image from private docker image repository

后端 未结 7 1194
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:14

    Private registry in Minikube

    kubectl create -f kube-registry.yaml

    (Grab kube-registry.yaml from this gist on github.)

    and you need port-forward minikube to localhost (Just image build time)

    kubectl port-forward --namespace kube-system \
    $(kubectl get po -n kube-system | grep kube-registry-v0 | \
    awk '{print $1;}') 5000:5000
    

    After this, from the host curl localhost:5000 should return a valid response from the docker registry running on minikube

    Repo : http://localhost:5000/v2/_catalog

    Pull image : localhost:5000/image_name:image_tag

    Reference: https://blog.hasura.io/sharing-a-local-registry-for-minikube-37c7240d0615

提交回复
热议问题