"minikube image ls" confusingly adds "docker.io/" prefix #19343
Description
What Happened?
When you load an image into Minikube, and then list the images using minikube image ls
, it may sometimes add docker.io/
or docker.io/library/
as a prefix to your image.
I was scratching my head over why this was happening, until I found this code:
https://github.com/kubernetes/minikube/blob/master/pkg/minikube/cruntime/docker.go#L699-L719
These prefixes are added based on a pretty arbitrary criterion -- whether the image name contains a dot or not. Apparently the idea is to force a leading domain name to be on an image, so as to turn busybox:latest
into docker.io/library/busybox:latest
.
This behavior might have made sense when DockerHub was the only game in town, but I don't think Minikube should a) misrepresent the actual RepoTags coming from Docker or b) privilege the docker.io
prefix in this way. After all, you can construct and load container images that have nothing to do with docker.io
but will still get prefixed.
When the reported RepoTags are different from the one in the image I loaded, it makes it difficult to verify that an image was loaded correctly. This is especially vexing when combined with the fact that minikube image load
sometimes silently fails.
If there's a good reason for this behavior please let me know. I just experimented with removing it and it seems to work fine. PR incoming.
Attach the log file
Operating System
Ubuntu
Driver
Docker