mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
0876742646
Signed-off-by: David Calavera <david.calavera@gmail.com>
20 lines
503 B
Go
20 lines
503 B
Go
package lib
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/docker/docker/api/types"
|
|
)
|
|
|
|
// ContainerInspect returns the all the container information.
|
|
func (cli *Client) ContainerInspect(containerID string) (types.ContainerJSON, error) {
|
|
serverResp, err := cli.GET("/containers/"+containerID+"/json", nil, nil)
|
|
if err != nil {
|
|
return types.ContainerJSON{}, err
|
|
}
|
|
defer serverResp.body.Close()
|
|
|
|
var response types.ContainerJSON
|
|
json.NewDecoder(serverResp.body).Decode(&response)
|
|
return response, err
|
|
}
|