@@ -18,7 +18,6 @@ import (
1818 "github.com/docker/buildx/util/buildflags"
1919 "github.com/docker/buildx/util/platformutil"
2020 "github.com/docker/cli/cli/config"
21- "github.com/docker/docker/builder/remotecontext/urlutil"
2221 hcl "github.com/hashicorp/hcl/v2"
2322 "github.com/moby/buildkit/client/llb"
2423 "github.com/moby/buildkit/session/auth/authprovider"
@@ -790,7 +789,7 @@ func updateContext(t *build.Inputs, inp *Input) {
790789 if strings .HasPrefix (v .Path , "cwd://" ) || strings .HasPrefix (v .Path , "target:" ) || strings .HasPrefix (v .Path , "docker-image:" ) {
791790 continue
792791 }
793- if IsRemoteURL (v .Path ) {
792+ if build . IsRemoteURL (v .Path ) {
794793 continue
795794 }
796795 st := llb .Scratch ().File (llb .Copy (* inp .State , v .Path , "/" ), llb .WithCustomNamef ("set context %s to %s" , k , v .Path ))
@@ -804,7 +803,7 @@ func updateContext(t *build.Inputs, inp *Input) {
804803 if strings .HasPrefix (t .ContextPath , "cwd://" ) {
805804 return
806805 }
807- if IsRemoteURL (t .ContextPath ) {
806+ if build . IsRemoteURL (t .ContextPath ) {
808807 return
809808 }
810809 st := llb .Scratch ().File (llb .Copy (* inp .State , t .ContextPath , "/" ), llb .WithCustomNamef ("set context to %s" , t .ContextPath ))
@@ -840,7 +839,7 @@ func validateContextsEntitlements(t build.Inputs, inp *Input) error {
840839}
841840
842841func checkPath (p string ) error {
843- if IsRemoteURL (p ) || strings .HasPrefix (p , "target:" ) || strings .HasPrefix (p , "docker-image:" ) {
842+ if build . IsRemoteURL (p ) || strings .HasPrefix (p , "target:" ) || strings .HasPrefix (p , "docker-image:" ) {
844843 return nil
845844 }
846845 p , err := filepath .EvalSymlinks (p )
@@ -876,15 +875,15 @@ func toBuildOpt(t *Target, inp *Input) (*build.Options, error) {
876875 if t .Context != nil {
877876 contextPath = * t .Context
878877 }
879- if ! strings .HasPrefix (contextPath , "cwd://" ) && ! IsRemoteURL (contextPath ) {
878+ if ! strings .HasPrefix (contextPath , "cwd://" ) && ! build . IsRemoteURL (contextPath ) {
880879 contextPath = path .Clean (contextPath )
881880 }
882881 dockerfilePath := "Dockerfile"
883882 if t .Dockerfile != nil {
884883 dockerfilePath = * t .Dockerfile
885884 }
886885
887- if ! isRemoteResource (contextPath ) && ! path .IsAbs (dockerfilePath ) {
886+ if ! build . IsRemoteURL (contextPath ) && ! path .IsAbs (dockerfilePath ) {
888887 dockerfilePath = path .Join (contextPath , dockerfilePath )
889888 }
890889
@@ -1040,10 +1039,6 @@ func removeDupes(s []string) []string {
10401039 return s [:i ]
10411040}
10421041
1043- func isRemoteResource (str string ) bool {
1044- return urlutil .IsGitURL (str ) || urlutil .IsURL (str )
1045- }
1046-
10471042func parseOutputType (str string ) string {
10481043 csvReader := csv .NewReader (strings .NewReader (str ))
10491044 fields , err := csvReader .Read ()
0 commit comments