简体   繁体   中英

Kubernetes error pulling of local registry

I'm trying to setup a local registry for local development with kubernetes.

I do this by: docker run -d -p 5000:5000 --name registry registry:2

I then build and tag a docker image:

docker tag apiservice localhost:5000/apiservice

push it to the registry:

docker push localhost:5000/apiservice

In my k82 deployment definition:

spec:
      containers:
      - name: apiserver
        image: localhost:5000/apiservice:latest

This is is the error: 在此处输入图片说明

What do I need to change to use minikube and a local docker container registry?

Are you running the registry on your machine's Docker or the Docker inside minikube? These are separate instances of DOcker, you can make them with:

eval $(minikube docker-env)

as explained here: https://github.com/kubernetes/minikube#reusing-the-docker-daemon

Then you will be able to pull Docker images from your local machine inside minikube.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM