To pull a Docker image from Minikube, you can follow these steps:
- Start Minikube by running the command:
- Set the Docker environment variables to use the Minikube Docker daemon by running the command:
eval $(minikube docker-env)
This sets the DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH environment variables to use Minikube's Docker daemon.
- Build the Docker image you want to pull using the Minikube Docker daemon. For example:
docker build -t my-image:latest .
Replace my-image with the desired image name and tag, and . with the path to your Dockerfile if it's not in the current directory.
- Verify that the image is built and available in the Minikube Docker daemon by running the command:
You should see your image listed in the output.
- Now you can use the image in your Kubernetes manifests or deployments.
Note: If you want to pull an image directly from a registry, you don't need to use Minikube's Docker daemon. Simply specify the image URL in your Kubernetes manifests or deployments, and Kubernetes will pull the image from the registry during deployment.