I have a Powershell script working calling simple Docker commands and volume mounting and thought It would be a good exercise to try with Dagger
for _, spec := range specs {
for _, settings := range spec.Settings {
if slices.Contains(languagesArg, settings.Language) {
stdout, err := dag.
Container().
From("mcr.microsoft.com/openapi/kiota:1.14.0").
WithMountedDirectory("/app/output", directoryArg).
WithoutUser().
WithExec([]string{
"generate",
"--output", fmt.Sprintf("/app/output/%s/%s", settings.Language, settings.Output),
"--language", string(settings.Language),
"--openapi", spec.URL,
"--exclude-backward-compatible", "true",
"--log-level", "Debug",
"--clean-output",
"--additional-data", "true",
"--class-name", "ApiClient",
}).
Stdout(ctx)
if err != nil {
return stdout, err
}
output += stdout
}
}
}
I get valid output, and I can see nothing went wrong, but the volume mounting doesnt seem to put contents back to the host and I tried simple echo 'test' > /output.txt options too, but nothing appears.
Am I misunderstanding what Dagger can do?
I have successfully built a few different docker images like C#, Go, Java, Python - Didnt publish locally since its more complicated and need a registry but im getting the hang of things. I just have now been blocked not understanding why I cant convert a powershell script using docker mounting and getting the container output back to the host is taking me far too long. Ive probably spent 4 hours with no progress 
I cant find any examples online either. The mutli stage examples were helpful but nothing about container - host interactions so much