#Directory.export Use in Python

1 messages · Page 1 of 1 (latest)

nova snow
#

I am trying to keep my dagger module as easy to use and minimising the input arguments for developers. So I want to use the built in Directory.export function to export build results from my container.
I have a function that builds code and returns a container object.
build_ctx = await self.build_core(source)
I've then tried to use this object to export a folder to the host
e.g. build_ctx.directory('/mnt/build-output-in-ctx').export("./build-out-on-host")
But nothing seems to be returned and I'm not seeing anything obvious in the traces that would indicate what's going wrong.

If I use the export argument then it works fine.

Am I doing something wrong with my code to do the export?

fickle ivy
nova snow
fickle ivy
#

Yeah, I think "path on the host" is misleading. It's written like that because that API was created before modules, which still works today. But in a Dagger module, there's still a use case for it, but not for exporting to the host where you're running the CLI from. It'll export into the container where the module is running.