I have the following golang function which tries to build a docker image from inside of dagger, but I get this error:
func build_docker_image(ctx context.Context, client *dagger.Client) {
// get reference to source code directory
source := client.Host().Directory(".", dagger.HostDirectoryOpts{
Exclude: []string{"ci", "build"},
})
app := client.Container().
From("docker:25-dind").
WithMountedDirectory("/src", source).
WithWorkdir("/src")
build, build_err := app.WithExec([]string{"docker", "build", "-t", "hexchess-server", "."}).Stdout(ctx)
if build_err != nil {
panic(build_err)
}
fmt.Println(build)
// Tag and publish the build
}