Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 4, 2020 06:16
Show Gist options
  • Select an option

  • Save ihcsim/ac3f69f08ebd78d509432f5b723e6ed7 to your computer and use it in GitHub Desktop.

Select an option

Save ihcsim/ac3f69f08ebd78d509432f5b723e6ed7 to your computer and use it in GitHub Desktop.
// Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
func (ds *dockerService) Exec(_ context.Context, req *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) {
if ds.streamingServer == nil {
return nil, streaming.NewErrorStreamingDisabled("exec")
}
_, err := checkContainerStatus(ds.client, req.ContainerId)
if err != nil {
return nil, err
}
return ds.streamingServer.GetExec(req)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment