Best thing would be a new registry like composer <a href="https://packagist.org" rel="nofollow">https://packagist.org</a> that is just a resolver to another server e.g. github.
So in the docker file you write XYZ/dockerimg and the registry redirect to the mapped correct docker registry.