|
@@ -16,10 +16,10 @@ import (
|
|
"github.com/docker/docker/api"
|
|
"github.com/docker/docker/api"
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types/container"
|
|
"github.com/docker/docker/api/types/container"
|
|
- "github.com/docker/docker/builder"
|
|
|
|
"github.com/docker/docker/builder/dockerignore"
|
|
"github.com/docker/docker/builder/dockerignore"
|
|
"github.com/docker/docker/cli"
|
|
"github.com/docker/docker/cli"
|
|
"github.com/docker/docker/cli/command"
|
|
"github.com/docker/docker/cli/command"
|
|
|
|
+ "github.com/docker/docker/cli/command/image/build"
|
|
"github.com/docker/docker/opts"
|
|
"github.com/docker/docker/opts"
|
|
"github.com/docker/docker/pkg/archive"
|
|
"github.com/docker/docker/pkg/archive"
|
|
"github.com/docker/docker/pkg/fileutils"
|
|
"github.com/docker/docker/pkg/fileutils"
|
|
@@ -29,7 +29,7 @@ import (
|
|
"github.com/docker/docker/pkg/urlutil"
|
|
"github.com/docker/docker/pkg/urlutil"
|
|
"github.com/docker/docker/reference"
|
|
"github.com/docker/docker/reference"
|
|
runconfigopts "github.com/docker/docker/runconfig/opts"
|
|
runconfigopts "github.com/docker/docker/runconfig/opts"
|
|
- "github.com/docker/go-units"
|
|
|
|
|
|
+ units "github.com/docker/go-units"
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -156,13 +156,13 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
|
|
|
|
|
|
switch {
|
|
switch {
|
|
case specifiedContext == "-":
|
|
case specifiedContext == "-":
|
|
- buildCtx, relDockerfile, err = builder.GetContextFromReader(dockerCli.In(), options.dockerfileName)
|
|
|
|
|
|
+ buildCtx, relDockerfile, err = build.GetContextFromReader(dockerCli.In(), options.dockerfileName)
|
|
case urlutil.IsGitURL(specifiedContext):
|
|
case urlutil.IsGitURL(specifiedContext):
|
|
- tempDir, relDockerfile, err = builder.GetContextFromGitURL(specifiedContext, options.dockerfileName)
|
|
|
|
|
|
+ tempDir, relDockerfile, err = build.GetContextFromGitURL(specifiedContext, options.dockerfileName)
|
|
case urlutil.IsURL(specifiedContext):
|
|
case urlutil.IsURL(specifiedContext):
|
|
- buildCtx, relDockerfile, err = builder.GetContextFromURL(progBuff, specifiedContext, options.dockerfileName)
|
|
|
|
|
|
+ buildCtx, relDockerfile, err = build.GetContextFromURL(progBuff, specifiedContext, options.dockerfileName)
|
|
default:
|
|
default:
|
|
- contextDir, relDockerfile, err = builder.GetContextFromLocalDir(specifiedContext, options.dockerfileName)
|
|
|
|
|
|
+ contextDir, relDockerfile, err = build.GetContextFromLocalDir(specifiedContext, options.dockerfileName)
|
|
}
|
|
}
|
|
|
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -198,7 +198,7 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if err := builder.ValidateContextDirectory(contextDir, excludes); err != nil {
|
|
|
|
|
|
+ if err := build.ValidateContextDirectory(contextDir, excludes); err != nil {
|
|
return fmt.Errorf("Error checking context: '%s'.", err)
|
|
return fmt.Errorf("Error checking context: '%s'.", err)
|
|
}
|
|
}
|
|
|
|
|