// forward container logs to stdout/stderr
forward container logs to stdout/stderr
// forward container logs to stdout / stderr
func startForwardingContainerLogs(
	ctx context.Context,
	cli *client.Client,
	containerID string,
	logger *log.Logger,
) error {
	reader, err := cli.ContainerLogs(
		ctx,
		containerID,
		types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true, Follow: true},
	)
	if err != nil {
		return err
	}
	go func() {
		defer reader.Close()
		if _, err := stdcopy.StdCopy(os.Stdout, os.Stderr, reader); err != nil {
			logger.Printf("Error while reading logs, %v\n", err)
		}
	}()
	return nil
}
func startForwardingContainerLogs ( ctx context . Context , cli * client . Client , containerID string , logger * log . Logger , ) error { reader , err := cli . ContainerLogs ( ctx , containerID , types . ContainerLogsOptions { ShowStdout : true , ShowStderr : true , Follow : true } , ) if err != nil { return err } go func ( ) { defer reader . Close ( ) if _ , err := stdcopy . StdCopy ( os . Stdout , os . Stderr , reader ) ; err != nil { logger . Printf ( " \n " , err ) } } ( ) return nil }
forward container logs to stdout/stderr
forward container logs to stdout / stderr