mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 17:37:46 +08:00
Merge pull request #1734 from jedevc/more-ssh-context-fixes
Various context fixups
This commit is contained in:
commit
b716e48926
@ -1102,7 +1102,7 @@ func toBuildOpt(t *Target, inp *Input) (*build.Options, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if len(sshSpecs) == 0 && buildflags.IsGitSSH(contextPath) {
|
if len(sshSpecs) == 0 && (buildflags.IsGitSSH(bi.ContextPath) || (inp != nil && buildflags.IsGitSSH(inp.URL))) {
|
||||||
sshSpecs = append(sshSpecs, &controllerapi.SSH{ID: "default"})
|
sshSpecs = append(sshSpecs, &controllerapi.SSH{ID: "default"})
|
||||||
}
|
}
|
||||||
sshAttachment, err := controllerapi.CreateSSH(sshSpecs)
|
sshAttachment, err := controllerapi.CreateSSH(sshSpecs)
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
"github.com/docker/cli/cli"
|
"github.com/docker/cli/cli"
|
||||||
"github.com/docker/cli/cli/command"
|
"github.com/docker/cli/cli/command"
|
||||||
dockeropts "github.com/docker/cli/opts"
|
dockeropts "github.com/docker/cli/opts"
|
||||||
|
"github.com/docker/docker/builder/remotecontext/urlutil"
|
||||||
"github.com/docker/docker/pkg/ioutils"
|
"github.com/docker/docker/pkg/ioutils"
|
||||||
"github.com/moby/buildkit/client"
|
"github.com/moby/buildkit/client"
|
||||||
"github.com/moby/buildkit/exporter/containerimage/exptypes"
|
"github.com/moby/buildkit/exporter/containerimage/exptypes"
|
||||||
@ -689,11 +690,13 @@ func resolvePaths(options *controllerapi.BuildOptions) (_ *controllerapi.BuildOp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if options.DockerfileName != "" && options.DockerfileName != "-" {
|
if options.DockerfileName != "" && options.DockerfileName != "-" {
|
||||||
|
if !urlutil.IsURL(options.DockerfileName) {
|
||||||
options.DockerfileName, err = filepath.Abs(options.DockerfileName)
|
options.DockerfileName, err = filepath.Abs(options.DockerfileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
var contexts map[string]string
|
var contexts map[string]string
|
||||||
for k, v := range options.NamedContexts {
|
for k, v := range options.NamedContexts {
|
||||||
if build.IsRemoteURL(v) || strings.HasPrefix(v, "docker-image://") {
|
if build.IsRemoteURL(v) || strings.HasPrefix(v, "docker-image://") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user