Reputation: 2100
I have just started working on k8s and I am doing some stuff locally,
I have a image created using docker desktop. Now, I want this image to be used within my minikube's VM environment. I want to create a deployment using kubectl create deployment hello-minikube --image=my_local_image_name
. Going through docs, and as per my understanding, it tells us how docker desktop can be used to interact with the minikube's in-built docker demon.
Following the instructions,
Running docker images
gives me images within minikube's docker.
But, in my case I want the other way around. How can I do that ?
Secondly, as a add-on how can I store images within minikube's VM's docker ?
Upvotes: 0
Views: 1576
Reputation: 21
Running docker images gives me images within minikube's docker.
When you have this behaviour in your shell, rebuild your docker image.
It will use Docker from Minikube and store your image into Minikube's Docker registry
Upvotes: 1
Reputation: 5521
Docker Desktop and Docker from Minikube are two separate Docker Engines. That is why they don't share the Docker image registry.
So you have the following options:
Use Kubernetes from Docker Desktop instead of Minikube (Docker Desktop comes with Kubernetes cluster built-in).
Build your Docker image with Docker Engine from Minikube (instead of Docker Desktop).
Use external Docker registry (you can use Docker Hub or set up your own registry)
Upvotes: 3