#Export assets to host

1 messages · Page 1 of 1 (latest)

split plover
#

In my pipeline I'm generating RPM packages and I want to put them in a directory in the host. I've tried WithMountedDirectory and I thought that if I put the assets in this directory they should be in the host but they don't.

I've tried using the Export function of the Directory struct but it does not work, this is what Im doing:

// Get the directory from the container
test_dir := d.builder.Directory(WorkDir + "/dbs_builder")
// Export the directory to the host
test_dir.Export(ctx, "/srv/tmp/test_export")

thanks!

split plover
#

Export assets to host

#

I've fixed it. I made my function return the directory and then piped it to the export function on the CLI:

dagger -vvv -c 'test-directory audit | export /srv/tmp/test_export'

left coral
#

calling Export within a function currently exports to the SDK sandbox container and not to the host. Some other users have raised this feedback before. We have an issue to address this https://github.com/dagger/dagger/issues/8235

GitHub

Problem In theory Dagger is perfect for generating code or docs. In practice, the logic for exporting files back to the client filesystem is simplistic and brittle, which makes the experience awkwa...

split plover
#

FYI google's gemini gave me the correct explanation 😄