本文整理匯總了Golang中github.com/docker/docker/client.ContainerAPIClient.ContainerExecInspect方法的典型用法代碼示例。如果您正苦於以下問題:Golang ContainerAPIClient.ContainerExecInspect方法的具體用法?Golang ContainerAPIClient.ContainerExecInspect怎麽用?Golang ContainerAPIClient.ContainerExecInspect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/docker/docker/client.ContainerAPIClient
的用法示例。
在下文中一共展示了ContainerAPIClient.ContainerExecInspect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getExecExitCode
// getExecExitCode perform an inspect on the exec command. It returns
// the running state and the exit code.
func getExecExitCode(ctx context.Context, client apiclient.ContainerAPIClient, execID string) (bool, int, error) {
resp, err := client.ContainerExecInspect(ctx, execID)
if err != nil {
// If we can't connect, then the daemon probably died.
if !apiclient.IsErrConnectionFailed(err) {
return false, -1, err
}
return false, -1, nil
}
return resp.Running, resp.ExitCode, nil
}