@@ -80,16 +80,16 @@ func RunStart(ctx context.Context, dockerCli command.Cli, opts *StartOptions) er
8080
8181 // 2. Attach to the container.
8282 ctr := opts .Containers [0 ]
83- c , err := dockerCli .Client ().ContainerInspect (ctx , ctr )
83+ c , err := dockerCli .Client ().ContainerInspect (ctx , ctr , client. ContainerInspectOptions {} )
8484 if err != nil {
8585 return err
8686 }
8787
8888 // We always use c.ID instead of container to maintain consistency during `docker start`
89- if ! c .Config .Tty {
89+ if ! c .Container . Config .Tty {
9090 sigc := notifyAllSignals ()
9191 bgCtx := context .WithoutCancel (ctx )
92- go ForwardAllSignals (bgCtx , dockerCli .Client (), c .ID , sigc )
92+ go ForwardAllSignals (bgCtx , dockerCli .Client (), c .Container . ID , sigc )
9393 defer signal .StopCatch (sigc )
9494 }
9595
@@ -100,7 +100,7 @@ func RunStart(ctx context.Context, dockerCli command.Cli, opts *StartOptions) er
100100
101101 options := client.ContainerAttachOptions {
102102 Stream : true ,
103- Stdin : opts .OpenStdin && c .Config .OpenStdin ,
103+ Stdin : opts .OpenStdin && c .Container . Config .OpenStdin ,
104104 Stdout : true ,
105105 Stderr : true ,
106106 DetachKeys : detachKeys ,
@@ -112,7 +112,7 @@ func RunStart(ctx context.Context, dockerCli command.Cli, opts *StartOptions) er
112112 in = dockerCli .In ()
113113 }
114114
115- resp , errAttach := dockerCli .Client ().ContainerAttach (ctx , c .ID , options )
115+ resp , errAttach := dockerCli .Client ().ContainerAttach (ctx , c .Container . ID , options )
116116 if errAttach != nil {
117117 return errAttach
118118 }
@@ -128,7 +128,7 @@ func RunStart(ctx context.Context, dockerCli command.Cli, opts *StartOptions) er
128128 outputStream : dockerCli .Out (),
129129 errorStream : dockerCli .Err (),
130130 resp : resp .HijackedResponse ,
131- tty : c .Config .Tty ,
131+ tty : c .Container . Config .Tty ,
132132 detachKeys : options .DetachKeys ,
133133 }
134134
@@ -142,26 +142,26 @@ func RunStart(ctx context.Context, dockerCli command.Cli, opts *StartOptions) er
142142
143143 // 3. We should open a channel for receiving status code of the container
144144 // no matter it's detached, removed on daemon side(--rm) or exit normally.
145- statusChan := waitExitOrRemoved (ctx , dockerCli .Client (), c .ID , c .HostConfig .AutoRemove )
145+ statusChan := waitExitOrRemoved (ctx , dockerCli .Client (), c .Container . ID , c . Container .HostConfig .AutoRemove )
146146
147147 // 4. Start the container.
148- err = dockerCli .Client ().ContainerStart (ctx , c .ID , client.ContainerStartOptions {
148+ err = dockerCli .Client ().ContainerStart (ctx , c .Container . ID , client.ContainerStartOptions {
149149 CheckpointID : opts .Checkpoint ,
150150 CheckpointDir : opts .CheckpointDir ,
151151 })
152152 if err != nil {
153153 cancelFun ()
154154 <- cErr
155- if c .HostConfig .AutoRemove {
155+ if c .Container . HostConfig .AutoRemove {
156156 // wait container to be removed
157157 <- statusChan
158158 }
159159 return err
160160 }
161161
162162 // 5. Wait for attachment to break.
163- if c .Config .Tty && dockerCli .Out ().IsTerminal () {
164- if err := MonitorTtySize (ctx , dockerCli , c .ID , false ); err != nil {
163+ if c .Container . Config .Tty && dockerCli .Out ().IsTerminal () {
164+ if err := MonitorTtySize (ctx , dockerCli , c .Container . ID , false ); err != nil {
165165 _ , _ = fmt .Fprintln (dockerCli .Err (), "Error monitoring TTY size:" , err )
166166 }
167167 }
0 commit comments