|
@@ -11,6 +11,7 @@ import (
|
|
"github.com/docker/docker/graph"
|
|
"github.com/docker/docker/graph"
|
|
"github.com/docker/docker/pkg/archive"
|
|
"github.com/docker/docker/pkg/archive"
|
|
"github.com/docker/docker/pkg/parsers"
|
|
"github.com/docker/docker/pkg/parsers"
|
|
|
|
+ "github.com/docker/docker/pkg/urlutil"
|
|
"github.com/docker/docker/registry"
|
|
"github.com/docker/docker/registry"
|
|
"github.com/docker/docker/utils"
|
|
"github.com/docker/docker/utils"
|
|
)
|
|
)
|
|
@@ -58,8 +59,8 @@ func (b *BuilderJob) CmdBuild(job *engine.Job) engine.Status {
|
|
|
|
|
|
if remoteURL == "" {
|
|
if remoteURL == "" {
|
|
context = ioutil.NopCloser(job.Stdin)
|
|
context = ioutil.NopCloser(job.Stdin)
|
|
- } else if utils.IsGIT(remoteURL) {
|
|
|
|
- if !utils.ValidGitTransport(remoteURL) {
|
|
|
|
|
|
+ } else if urlutil.IsGitURL(remoteURL) {
|
|
|
|
+ if !urlutil.IsGitTransport(remoteURL) {
|
|
remoteURL = "https://" + remoteURL
|
|
remoteURL = "https://" + remoteURL
|
|
}
|
|
}
|
|
root, err := ioutil.TempDir("", "docker-build-git")
|
|
root, err := ioutil.TempDir("", "docker-build-git")
|
|
@@ -77,7 +78,7 @@ func (b *BuilderJob) CmdBuild(job *engine.Job) engine.Status {
|
|
return job.Error(err)
|
|
return job.Error(err)
|
|
}
|
|
}
|
|
context = c
|
|
context = c
|
|
- } else if utils.IsURL(remoteURL) {
|
|
|
|
|
|
+ } else if urlutil.IsURL(remoteURL) {
|
|
f, err := utils.Download(remoteURL)
|
|
f, err := utils.Download(remoteURL)
|
|
if err != nil {
|
|
if err != nil {
|
|
return job.Error(err)
|
|
return job.Error(err)
|