#Export to host from (Go) code

1 messages · Page 1 of 1 (latest)

worldly oyster
#

Hi there, new to Dagger. Is it possible to use (* Directory).Export from Dagger code?

Running build | export _site from Dagger shell command does what I expect. However in Go code, m.Build(ctx, source).Export(ctx, "_site") does not create the _site directory on the host. I guess it does so in the Dagger module runtime container (?)

Is it possible to create a directory on the host directly from Dagger code, or is one required to do it from the command line only ?

fluid bridge
#

here's an example:

dagger -c "container | from alpine | file /etc/os-release | export alpine-release"

^ if you run that, you should have an alpine-release file in your CWD afterwards

worldly oyster
#

Yes it works sorry if that wasn’t clear. I was wondering why the equivalent Go code behaves differently

#

And if there is a way to generate a directory on the host without explicitly specifying the export on the command line.

worldly oyster