Local Image Registry
About
There are few things that you can do if you choose to host a local image registry on your NAS. However; configuring your NAS storage is outside the scope of this setup as it varies between different setups of what you have locally.
Getting Started
When you pull an image from the docker official registry, you are pulling over HTTPS, when using a local registry you will be pulling over HTTP. In this guide you will see how we can configure Microk8s to allow insecure registries.
Configuring Microk8s
Microk8s 1.23 and newer use separate host.toml
files for each registry. For this guide we will assume your registry
is reachable on this IP 10.42.0.22
and is listening on port 5050
First, let’s begin with creating a new directory for your registry:
Then we will create the host.toml file
Edit hosts.toml file to include the following
Restart Microk8s for the new configuration to be loaded
Pushing Images to Local Image Registry
Now that you have the local registry trusted by Microk8s let’s push our first image
Pull an image from the official docker registry
Tag the image you want to push to your local registry
Push the tagged image to your local registry
That’s it! You are now ready to use your local registry for your infrastructure