Non dockerhub registry mirror

I am new to docker. I have a registry mirror. This mirror is not the mirror of docker hub e.g. and is running on http://localhost:9494.
I have searched about configuring docker to use the local registry mirror instead of but I can’t achieve anything.
This config is available in k8s in the config.toml file and changing endpoints for mirrors. Is it possible to do this under docker and docker-compose?

There is a way to use a pull through cache, but if you just want to upload an image to an other registry, you need to add a new tag to the existing image to match the new registry like:

docker tag elasticsearch localhost:9494/elasticsearch

then you can push it to the new registry and change the k8s config to pull the images from the new registry which will only work if k8s can see the same localhost.