Image tagged `localhost/container-name`, previously working fine, now trying to pull from http://localhost/ instead

I’ve been building images and tagging them as localhost/container-name on my local machine, to differentiate them from private.registry.com/container-name in image listings, docker compose files, et al. Until today, this worked. This morning, I’m getting connection refused messages from one of the deployments trying to “pull” from localhost instead of using the locally tagged image. Removing localhost/ from the tag name has made everything well again.

Has Docker internal behavior changed, in some way? I understand that using localhost as a prefix for local image tags was never an official practice, and I’m not so embedded in prepending localhost to my image names yet that I can’t easily switch back, I’m mostly just curious what happened.

I don’t know about any change, but I name my local images the same way. Exactly because if I want to push them it will never be able to push it to a registry so I always know that it was mine.

Please tell us more about your environment. Operating system, Docker version and how you installed Docker.