diff --git a/cli/command/image/build/internal/urlutil/urlutil.go b/cli/command/image/build/internal/urlutil/urlutil.go index e8459cc820..34c603cbc3 100644 --- a/cli/command/image/build/internal/urlutil/urlutil.go +++ b/cli/command/image/build/internal/urlutil/urlutil.go @@ -6,13 +6,14 @@ package urlutil // import "github.com/docker/docker/builder/remotecontext/urlutil" import ( - "regexp" "strings" + + "github.com/docker/docker/internal/lazyregexp" ) // urlPathWithFragmentSuffix matches fragments to use as Git reference and build // context from the Git repository. See IsGitURL for details. -var urlPathWithFragmentSuffix = regexp.MustCompile(`\.git(?:#.+)?$`) +var urlPathWithFragmentSuffix = lazyregexp.New(`\.git(?:#.+)?$`) // IsURL returns true if the provided str is an HTTP(S) URL by checking if it // has a http:// or https:// scheme. No validation is performed to verify if the