(containerID string, dockerClient *Client)
| 227 | } |
| 228 | |
| 229 | func StreamDockerLogsFn(containerID string, dockerClient *Client) func() error { |
| 230 | return func() error { |
| 231 | // Use ContainerLogs() so lines are only printed once they end in \n |
| 232 | logsOutput, err := dockerClient.ContainerLogs(context.Background(), containerID, dockertypes.ContainerLogsOptions{ |
| 233 | ShowStdout: true, |
| 234 | ShowStderr: true, |
| 235 | Follow: true, |
| 236 | }) |
| 237 | if err != nil { |
| 238 | return WrapDockerError(err) |
| 239 | } |
| 240 | |
| 241 | _, err = io.Copy(os.Stdout, logsOutput) |
| 242 | if err != nil && err != io.EOF { |
| 243 | return errors.WithStack(err) |
| 244 | } |
| 245 | |
| 246 | return nil |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | // The provided input will be extracted into the container's containerPath directory |
| 251 | func CopyToContainer(containerID string, input *archive.Input, containerPath string) error { |
no test coverage detected