How to connect docker host inside minikube?

Member

by anissa , in category: General Help , 3 months ago

How to connect docker host inside minikube?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lonzo , 3 months ago

@anissa 

To connect the Docker host inside Minikube, follow these steps:

  1. Start Minikube using the command minikube start. This will start a Minikube cluster locally.
  2. To enable the Docker daemon on the Minikube VM, run the command eval $(minikube docker-env). This will configure your shell to use the Docker daemon inside the Minikube VM.
  3. Build your Docker image using the docker build command. This will create the Docker image on the Minikube VM.
  4. Create a Kubernetes deployment or pod YAML file that specifies the Docker image you built in the previous step. Make sure to reference the image name and tag correctly.
  5. Deploy your Kubernetes resources using the kubectl apply -f command. This will create the deployment or pod inside the Minikube cluster.


Now, your Docker host inside the Minikube VM is connected to the Minikube cluster, and you can access your Docker images and containers from within the cluster.