Do you have an example of code I can use to reproduce it?
I did try and I have both stdout and stderr visible.
I prefixed them with stdout/stderr and added (func) for the ones emitted by the function itself, and (ctr) for the ones emitted by the container.
The output:
$ dagger call container-echo --string-arg plop combined-output -E
▼ ✔ MyModule.containerEcho(stringArg: "plop"): Container! 2.4s
● ✔ container: Container! 0.0s
● $ .from(address: "alpine:latest"): Container! 0.5s CACHED
▶ ✔ withExec sh -c 'echo "stdout(ctr): $1" && echo "stderr(ctr): $1" >&2' -- plop 0.1s
stderr(func): plop
stdout(func): plop
✔ connect 0.2s
✔ load module: . 0.6s
✔ parsing command line arguments 0.0s
✔ myModule: MyModule! 0.0s
✔ .containerEcho(stringArg: "plop"): Container! 2.4s
✔ .combinedOutput: String! 0.1s
stdout(ctr): plop
stderr(ctr): plop
The module
package main
import (
"fmt"
"os"
"dagger/my-module/internal/dagger"
)
type MyModule struct{}
func (m *MyModule) ContainerEcho(stringArg string) *dagger.Container {
fmt.Fprintln(os.Stdout, "stdout(func): "+stringArg)
fmt.Fprintln(os.Stderr, "stderr(func): "+stringArg)
return dag.Container().From("alpine:latest").WithExec([]string{"sh", "-c", "echo \"stdout(ctr): $1\" && echo \"stderr(ctr): $1\" >&2", "--", stringArg})
}