Docker source does not work with registries hosted at subpaths
Currently the docker
source pluging accepts only the full URL of the image as parameter and then tries to split that URL into registry URL and image name. This is done by splitting the URL here and assuming that the hostname part of the URL is the registry and the rest of it is the image name. This assumption works with Docker Hub (which is usually what people want) but fails when the registry endpoint is hosted at a subpath, like https://myawesomeregistry.com/this-is-the-not-image-path/images/<image>
. This becomes a problem because when it tries to use the registry URL to get the manifest here.
I think a good way to tackle this would be to separate out the registry and image name parameters. This would eliminate the ambiguity. Also, if we make Docker Hub the default registry, that would automatically reduce a bunch of cruft from people's element definitions. I imagine that the new config would look something like this:
kind: docker
# This is the OLD format, which should be deprecated
# url: https://registry.hub.docker.com/library/alpine
# The NEW format
registry-url: https://registry.hub.docker.com # Default to Docker Hub
image: library/alpine
If we want to adopt this new scheme, there are a few questions that we'll need to answer:
- What will be the names of the new fields?
- What happens to old
url
and how can we deprecate it?
Thoughts?
Also see related mailing list thread: https://mail.gnome.org/archives/buildstream-list/2018-June/msg00039.html