Summary
When you use uri's for locations for docker with registries e.g.
uri = docker://localhost:5000/foo/bar
These are considered invalid uri's uris iwthout ports work perfectly.
Expected behavior
To be able to use uri's with ports
Root cause appears to be this regexp https://github.com/buildpacks/pack/blob/main/pkg/buildpack/locator_type.go#L39
var (
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
semverPattern = `(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?`
registryPattern = regexp.MustCompile(`^[a-z0-9\-\.]+\/[a-z0-9\-\.]+(?:@` + semverPattern + `)?$`)
)
The registryPattern does not match as does not consider ports this simple change to the regexp resolves this ISSUE
var (
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
semverPattern = `(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?`
registryPattern = regexp.MustCompile(`^[a-z0-9\-\.]+(?:|:[0-9]+)\/[a-z0-9\-\.]+(?:@` + semverPattern + `)?$`)
)
Summary
When you use uri's for locations for docker with registries e.g.
These are considered invalid uri's uris iwthout ports work perfectly.
Expected behavior
To be able to use uri's with ports
Root cause appears to be this regexp https://github.com/buildpacks/pack/blob/main/pkg/buildpack/locator_type.go#L39
The registryPattern does not match as does not consider ports this simple change to the regexp resolves this ISSUE