Push images into private Docker Registry

Simple step-by-step guide on how to push images into a private Docker Registry in your HomeLab or Local Network.

1 - First get the direction of the registry

In my case this is a private registry which consist of the [homelab-node-ip-from-tailscale:registry]-[service-port]. I exported it locally so I don't have to type the whole address on every command.

export REGIP="[ip-homelab-node-from-tailscale:registry]-[service-port]"
2- Add to Docker list of insecure repositories

Since this is a private repository and I didn't set up the SSL certificate, I had to make sure that is added to the Docker list of insecure repositories. You can find that list at /etc/docker/daemon.json.

3 - Then make sure you do the build from your Dockerfile with the command:
docker build -f Dockerfile -t [image-name]:[version] .
4 - Tag the build of the image using:
docker tag [image-name]:[version] $REGIP/[image-name]:[version]
5 - Push the build to the registry:
docker push $REGIP/[image-name]:[version]