#Is there a way to copy files from an

1 messages · Page 1 of 1 (latest)

elder shore
#

Hmm seems stuff created in terminal can't even be exported like this

func (b *YoctoBuilder) Terminal() error {
    _, err := b.setupBuild().
        Terminal().
        Directory("/export").
        Export(b.runContext, "terminal-export", dagger.DirectoryExportOpts{Wipe: false})

    return err
}
✘ Container.directory(path: "/export"): Directory! 0.0s
! lstat /export: no such file or directory
wooden spindle
elder shore
#

ahhhh bummmer - getting files out of this would be huge. we set up a lot of context in dagger, and allow devs to drop into the terminal for iteration. getting files out is a confusing roadblock for them :/

wooden spindle
#

I think there's a trick with cache volumes @elder shore

#

Checking with @idle meteor our resident master of tricks and hacks

idle meteor
# wooden spindle I think there's a trick with cache volumes <@280220446971133952>

yep, the only way to make this work currently is via cache-volumes @elder shore

i.e:

func (m *Lala) Test() *dagger.Container {
    return dag.Container().From("alpine").
        WithMountedCache("/cache", dag.CacheVolume("cache")).
        Terminal().
        WithExec([]string{"cp", "-r", "/cache", "/out"})

}

and then dagger call test directory --path /out export --path ./out

#

and whatever you put in /cache in the terminal session will get exported