<p>according to docs for <a href="https://docs.docker.com/engine/reference/commandline/pull/#pull-from-a-different-registry" rel="nofollow noreferrer">pulling</a> from and <a href="https://docs.docker.com/engine/reference/commandline/push/#push-a-new-image-to-a-registry" rel="nofollow noreferrer">pushing</a> to a local registry, you have to tag an image like this :</p>
<pre><code>docker image tag rhel-httpd:latest registry-host:5000/myadmin/rhel-httpd:latest
docker image push registry-host:5000/myadmin/rhel-httpd:latest
</code></pre>
<p>right now I have a lot of deployments and helm charts in my on-prem k8s cluster and it's not really convenient to rename all the reference images every time our registry address changes.
is there any way to change the default registry without tagging the images?</p>
<p>i'm using <code>registry:2</code> image to run a local docker registry with docker compose like this:</p>
<pre><code>version: &quot;3&quot;
services:
  registry:
      image: registry:2
      ports:
        - 5000:5000
      environment:
        - REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
      restart: unless-stopped
      volumes:
        - ./data:/data
</code></pre>

aSaffary
<p>so as David Maze suggested and as it's been discussed <a href="https://stackoverflow.com/a/67351972/9940814">in this answer</a> and <a href="https://github.com/moby/moby/issues/7203" rel="nofollow noreferrer">this issue</a> it's best that we don't change the default registry.
I ended up using a parameter inside my helm chart's <code>values.yaml</code> file.
just an example of how it could be done :</p>
<pre><code>#values.yaml
docker_registry: my.local.registry/
image_name: my_image_name
</code></pre>
<p>and then in any template that's addressing the image use <code>{{ .Values.docker_registry}}{{ .Values.image_name}}</code> instead of <code>{{ .Values.image_name}}</code></p>
<p>we can also use the default registry by setting <code>docker_registry : docker.io/</code></p>
