#mkdir and cp commands
1 messages · Page 1 of 1 (latest)
Do you mean:
package main
import (
"context"
"os"
"dagger.io/dagger"
"github.com/wingyplus/must"
)
func main() {
client := must.Must(dagger.Connect(context.Background(), dagger.WithLogOutput(os.Stderr)))
defer client.Close()
client.
Container().
From("ubuntu").
WithExec([]string{"mkdir", "hello"}).
WithExec([]string{"ls", "-la"}).
Stdout(context.Background())
}
The key, as shown in the golang example above, is to actually trigger the execution of the pipeline by using a "leaf" or "finalizing" operation like stdout or exit_code. The pipelines are lazy and only execute when you trigger them with an operation like that. There is a proposal to use sync as a way to force execution up to a point: https://github.com/dagger/dagger/issues/5065