Default registry as docker.io
The default registry should be configured as docker.io. This is the most common use case and should not require any extra configuration.
Identified during hacking with @michelleN at #KubeCon
Hey! To provide a little background context, we opted to go for the default being unset for a couple reasons:
- The majority of early adopters hacking on apps with Draft all tend to use Minikube/Docker for Mac
- Minikube/DfM users wanted a way to opt out of pushing to a container registry as it was deemed unnecessary for their use case (see #102 and #432 for more context)
After hearing feedback from users, I actually disagree that the most common use case is using DockerHub with Draft. We heard that the setup required to interact with a public container registry was very tricky/clumsy to start out. Keeping in mind that we are trying to target new developers who have not yet tried out Docker/Kubernetes:
- the user needs to create an account on DockerHub by default. Not a big issue, but it's still another step in the setup instructions
- the user will still need to configure the user account they're pushing the image to, so
draft config set registry bacongobblerwill now become a required step in the process. - the user needs to create the repository on DockerHub before calling
draft upfor the first time. Again, another step in the setup - pushing to a container registry takes a huge performance hit when hacking on code for Minikube users. Airplane wifi comes to mind here
- For cloud users, we've heard that most would prefer to opt into the container registry provided by their cloud of choice for privacy reasons as opposed to a public cloud, e.g ACR for Azure, GCR for Google, ECR for AWS. #500 was a starting point to provision a cloud with their registry of choice, but we closed it in favour of running
docker builds locally similar to Skaffold as it was a better overall fit.
All in all the experience to use DockerHub for a new user was found to be quite clunky, especially for users new to the Docker ecosystem. If most users were hacking on Kubernetes apps using cloud infrastructure, then I'd see the value in this, but I'm fairly skeptical about that actually being the case for a FOSS dev tool aimed at developers new to the space.
Always happy to hear this sort of feedback, so please feel free to elaborate on your thoughts here :)
I feel that defaulting to docker.io might even be dangerous to newcomers: he/she might "accidentially" push a public image (that's still the default for docker.io, right?), which might not be what he/she wants.
Important note : you can set the default registry in the toml file, and you can pull in custom toml files already, so an org can globally apply a standard.
But I still definitely understand the request...
We could perhaps extend draft init through the --config flag as we do with plugins. I'll think through some ideas.
Good point though @squillace. If a user overrides the app's draft.toml with a registry field then we'll use that regardless of what's shown in draft config list. I also understand the request as well, but from previous feedback we opted to go a different route. :)