7
7
8
8
"golang.org/x/net/context"
9
9
10
- "github.com/docker/docker/api/client"
11
10
"github.com/docker/docker/cli"
11
+ "github.com/docker/docker/cli/command"
12
12
"github.com/docker/docker/pkg/jsonmessage"
13
13
// FIXME migrate to docker/distribution/reference
14
14
"github.com/docker/docker/api/types"
@@ -27,7 +27,7 @@ type createOptions struct {
27
27
}
28
28
29
29
// NewCreateCommand creates a new cobra.Command for `docker create`
30
- func NewCreateCommand (dockerCli * client .DockerCli ) * cobra.Command {
30
+ func NewCreateCommand (dockerCli * command .DockerCli ) * cobra.Command {
31
31
var opts createOptions
32
32
var copts * runconfigopts.ContainerOptions
33
33
@@ -53,12 +53,12 @@ func NewCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
53
53
// with hostname
54
54
flags .Bool ("help" , false , "Print usage" )
55
55
56
- client .AddTrustedFlags (flags , true )
56
+ command .AddTrustedFlags (flags , true )
57
57
copts = runconfigopts .AddFlags (flags )
58
58
return cmd
59
59
}
60
60
61
- func runCreate (dockerCli * client .DockerCli , flags * pflag.FlagSet , opts * createOptions , copts * runconfigopts.ContainerOptions ) error {
61
+ func runCreate (dockerCli * command .DockerCli , flags * pflag.FlagSet , opts * createOptions , copts * runconfigopts.ContainerOptions ) error {
62
62
config , hostConfig , networkingConfig , err := runconfigopts .Parse (flags , copts )
63
63
if err != nil {
64
64
reportError (dockerCli .Err (), "create" , err .Error (), true )
@@ -72,7 +72,7 @@ func runCreate(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts *createOp
72
72
return nil
73
73
}
74
74
75
- func pullImage (ctx context.Context , dockerCli * client .DockerCli , image string , out io.Writer ) error {
75
+ func pullImage (ctx context.Context , dockerCli * command .DockerCli , image string , out io.Writer ) error {
76
76
ref , err := reference .ParseNamed (image )
77
77
if err != nil {
78
78
return err
@@ -85,7 +85,7 @@ func pullImage(ctx context.Context, dockerCli *client.DockerCli, image string, o
85
85
}
86
86
87
87
authConfig := dockerCli .ResolveAuthConfig (ctx , repoInfo .Index )
88
- encodedAuth , err := client .EncodeAuthToBase64 (authConfig )
88
+ encodedAuth , err := command .EncodeAuthToBase64 (authConfig )
89
89
if err != nil {
90
90
return err
91
91
}
@@ -147,7 +147,7 @@ func newCIDFile(path string) (*cidFile, error) {
147
147
return & cidFile {path : path , file : f }, nil
148
148
}
149
149
150
- func createContainer (ctx context.Context , dockerCli * client .DockerCli , config * container.Config , hostConfig * container.HostConfig , networkingConfig * networktypes.NetworkingConfig , cidfile , name string ) (* types.ContainerCreateResponse , error ) {
150
+ func createContainer (ctx context.Context , dockerCli * command .DockerCli , config * container.Config , hostConfig * container.HostConfig , networkingConfig * networktypes.NetworkingConfig , cidfile , name string ) (* types.ContainerCreateResponse , error ) {
151
151
stderr := dockerCli .Err ()
152
152
153
153
var containerIDFile * cidFile
@@ -167,7 +167,7 @@ func createContainer(ctx context.Context, dockerCli *client.DockerCli, config *c
167
167
if ref != nil {
168
168
ref = reference .WithDefaultTag (ref )
169
169
170
- if ref , ok := ref .(reference.NamedTagged ); ok && client .IsTrusted () {
170
+ if ref , ok := ref .(reference.NamedTagged ); ok && command .IsTrusted () {
171
171
var err error
172
172
trustedRef , err = dockerCli .TrustedReference (ctx , ref )
173
173
if err != nil {
0 commit comments