K8S Load Docker Image
This article provides a comprehensive guide on building, uploading, and loading Docker images for Kubernetes-based microk8s or Minikube. Additionally, it covers the process of importing images specifically for lightweight K3s distribution that utilizes the Docker container runtime.
first of all, you can build and upload docker image to registry.
1 | docker login |
you can upload to docker.io or microk8s provided local registry.
https://microk8s.io/docs/registry-built-in
1 | # for microk8s the registry address is localhost:32000 |
you can also build image with minikube:
1 | minikube image build -t <imagename> -f <dockerfile_path> <resource_path> |
load image exported with docker save <image>:<tag>
1 | # ref: https://minikube.sigs.k8s.io/docs/commands/image/ |
https://blog.scottlowe.org/2020/01/25/manually-loading-container-images-with-containerd/
https://docs.k3s.io/installation/registry-mirror#pushing-images
you can also configure k8s to use docker as container runtime instead.
https://github.com/canonical/microk8s/issues/287
https://docs.k3s.io/advanced#using-docker-as-the-container-runtime