#[SOLVED] Log container.Exec into stdout

1 messages · Page 1 of 1 (latest)

ivory creek
#

How to get the stdout please? My code:

ciContainer = ciContainer.Exec(dagger.ContainerExecOpts{
    Args: []string{"bash", "--version"},
    RedirectStdout : "",
    RedirectStderr: "",
})
```What does `RedirectStdout` should look like?
I want to `fmt.Println` the stdout, thanks
torn comet
#
output, err := ciContainer.Exec(dagger.ContainerExecOpts{
    Args: []string{"bash", "--version"},
}).Stdout().Contents(ctx)
fmt.Println(output)
ivory creek
#

Thanks a lot 🙂

#

Here is my code now:

ciContainer = ciContainer.Exec(dagger.ContainerExecOpts{
    Args:           []string{"bash", "--version"},
})

output, err := ciContainer.Stdout().Contents(ctx)
if err != nil {
    return err
}
fmt.Println(output)
#

[SOLVED] Log container.Exec into stdout