|
|
|
@ -18,7 +18,6 @@ import (
|
|
|
|
|
"github.com/docker/buildx/util/buildflags"
|
|
|
|
|
"github.com/docker/buildx/util/platformutil"
|
|
|
|
|
"github.com/docker/cli/cli/config"
|
|
|
|
|
"github.com/docker/docker/builder/remotecontext/urlutil"
|
|
|
|
|
hcl "github.com/hashicorp/hcl/v2"
|
|
|
|
|
"github.com/moby/buildkit/client/llb"
|
|
|
|
|
"github.com/moby/buildkit/session/auth/authprovider"
|
|
|
|
@ -790,7 +789,7 @@ func updateContext(t *build.Inputs, inp *Input) {
|
|
|
|
|
if strings.HasPrefix(v.Path, "cwd://") || strings.HasPrefix(v.Path, "target:") || strings.HasPrefix(v.Path, "docker-image:") {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
if IsRemoteURL(v.Path) {
|
|
|
|
|
if build.IsRemoteURL(v.Path) {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
|
if strings.HasPrefix(t.ContextPath, "cwd://") {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if IsRemoteURL(t.ContextPath) {
|
|
|
|
|
if build.IsRemoteURL(t.ContextPath) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
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 {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func checkPath(p string) error {
|
|
|
|
|
if IsRemoteURL(p) || strings.HasPrefix(p, "target:") || strings.HasPrefix(p, "docker-image:") {
|
|
|
|
|
if build.IsRemoteURL(p) || strings.HasPrefix(p, "target:") || strings.HasPrefix(p, "docker-image:") {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
p, err := filepath.EvalSymlinks(p)
|
|
|
|
@ -876,7 +875,7 @@ func toBuildOpt(t *Target, inp *Input) (*build.Options, error) {
|
|
|
|
|
if t.Context != nil {
|
|
|
|
|
contextPath = *t.Context
|
|
|
|
|
}
|
|
|
|
|
if !strings.HasPrefix(contextPath, "cwd://") && !IsRemoteURL(contextPath) {
|
|
|
|
|
if !strings.HasPrefix(contextPath, "cwd://") && !build.IsRemoteURL(contextPath) {
|
|
|
|
|
contextPath = path.Clean(contextPath)
|
|
|
|
|
}
|
|
|
|
|
dockerfilePath := "Dockerfile"
|
|
|
|
@ -884,7 +883,7 @@ func toBuildOpt(t *Target, inp *Input) (*build.Options, error) {
|
|
|
|
|
dockerfilePath = *t.Dockerfile
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !isRemoteResource(contextPath) && !path.IsAbs(dockerfilePath) {
|
|
|
|
|
if !build.IsRemoteURL(contextPath) && !path.IsAbs(dockerfilePath) {
|
|
|
|
|
dockerfilePath = path.Join(contextPath, dockerfilePath)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1040,10 +1039,6 @@ func removeDupes(s []string) []string {
|
|
|
|
|
return s[:i]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func isRemoteResource(str string) bool {
|
|
|
|
|
return urlutil.IsGitURL(str) || urlutil.IsURL(str)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func parseOutputType(str string) string {
|
|
|
|
|
csvReader := csv.NewReader(strings.NewReader(str))
|
|
|
|
|
fields, err := csvReader.Read()
|
|
|
|
|