That'd probably be ideal but in reality most people don't do that.
Worse, I've had people scoff at the idea.
And then things like the Docker Hub outage this week happen and people wonder why their pipelines grind to a halt.
How hard is it to set up your own hub for private use ?
It's easy.
You can host a Docker registry yourself (e.g. Harbor or Portus), or use a managed one, like Google Cloud Registry if you use GCP / GKE.
To publish an image to your own registry, you just need to pull from Docker Hub, re-tag the image, and push to your own repo. It's three commands.
You can add some automated and/or manual steps to check the images for security flaws before publishing them.
basically a docker run, but if you need it in production, there's a couple other things you need to do.
They are supposed to. But as far as I remember among the bad practices perpetrated by the Docker developers there is even an unshakeable stance against adding an option to the mainline Docker so it doesn't try to connect to DockerHub when searching for the image to download.
can you imagine a team volunteering for that? Nah, they’ll hope for the best from the public registry.
The way people tackle their dependencies inside docker is utterly irresponsible.