|
@@ -7,8 +7,8 @@ import (
|
|
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
|
|
- "github.com/docker/docker/api/client"
|
|
|
"github.com/docker/docker/cli"
|
|
|
+ "github.com/docker/docker/cli/command"
|
|
|
"github.com/docker/docker/pkg/jsonmessage"
|
|
|
// FIXME migrate to docker/distribution/reference
|
|
|
"github.com/docker/docker/api/types"
|
|
@@ -27,7 +27,7 @@ type createOptions struct {
|
|
|
}
|
|
|
|
|
|
// NewCreateCommand creates a new cobra.Command for `docker create`
|
|
|
-func NewCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
|
|
|
+func NewCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|
|
var opts createOptions
|
|
|
var copts *runconfigopts.ContainerOptions
|
|
|
|
|
@@ -53,12 +53,12 @@ func NewCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
|
|
|
// with hostname
|
|
|
flags.Bool("help", false, "Print usage")
|
|
|
|
|
|
- client.AddTrustedFlags(flags, true)
|
|
|
+ command.AddTrustedFlags(flags, true)
|
|
|
copts = runconfigopts.AddFlags(flags)
|
|
|
return cmd
|
|
|
}
|
|
|
|
|
|
-func runCreate(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts *createOptions, copts *runconfigopts.ContainerOptions) error {
|
|
|
+func runCreate(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *createOptions, copts *runconfigopts.ContainerOptions) error {
|
|
|
config, hostConfig, networkingConfig, err := runconfigopts.Parse(flags, copts)
|
|
|
if err != nil {
|
|
|
reportError(dockerCli.Err(), "create", err.Error(), true)
|
|
@@ -72,7 +72,7 @@ func runCreate(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts *createOp
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func pullImage(ctx context.Context, dockerCli *client.DockerCli, image string, out io.Writer) error {
|
|
|
+func pullImage(ctx context.Context, dockerCli *command.DockerCli, image string, out io.Writer) error {
|
|
|
ref, err := reference.ParseNamed(image)
|
|
|
if err != nil {
|
|
|
return err
|
|
@@ -85,7 +85,7 @@ func pullImage(ctx context.Context, dockerCli *client.DockerCli, image string, o
|
|
|
}
|
|
|
|
|
|
authConfig := dockerCli.ResolveAuthConfig(ctx, repoInfo.Index)
|
|
|
- encodedAuth, err := client.EncodeAuthToBase64(authConfig)
|
|
|
+ encodedAuth, err := command.EncodeAuthToBase64(authConfig)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -147,7 +147,7 @@ func newCIDFile(path string) (*cidFile, error) {
|
|
|
return &cidFile{path: path, file: f}, nil
|
|
|
}
|
|
|
|
|
|
-func createContainer(ctx context.Context, dockerCli *client.DockerCli, config *container.Config, hostConfig *container.HostConfig, networkingConfig *networktypes.NetworkingConfig, cidfile, name string) (*types.ContainerCreateResponse, error) {
|
|
|
+func createContainer(ctx context.Context, dockerCli *command.DockerCli, config *container.Config, hostConfig *container.HostConfig, networkingConfig *networktypes.NetworkingConfig, cidfile, name string) (*types.ContainerCreateResponse, error) {
|
|
|
stderr := dockerCli.Err()
|
|
|
|
|
|
var containerIDFile *cidFile
|
|
@@ -167,7 +167,7 @@ func createContainer(ctx context.Context, dockerCli *client.DockerCli, config *c
|
|
|
if ref != nil {
|
|
|
ref = reference.WithDefaultTag(ref)
|
|
|
|
|
|
- if ref, ok := ref.(reference.NamedTagged); ok && client.IsTrusted() {
|
|
|
+ if ref, ok := ref.(reference.NamedTagged); ok && command.IsTrusted() {
|
|
|
var err error
|
|
|
trustedRef, err = dockerCli.TrustedReference(ctx, ref)
|
|
|
if err != nil {
|