#Run arbitrary code inside dagger module

1 messages · Page 1 of 1 (latest)

nimble idol
#

I've been playing with dagger for a couple days now and one thing I occassionally run into is the desire to execute some code in the module. My most recent example is trying to extract git information from a src directory passed to the module that is a dagger.Directory type.

I believe this is just how dagger works in that I cannot find this path via code using some go module like go-git to extract the information I need. Instead I bascially have to exec a bunch of git cmds and parse the output. Is there an altnerative to this?

#

Run arbitrary code inside dagger module

timid olive
nimble idol
#

If the code I'm calling needs to interact with a directory or file in the container how can I do that? From what I could see there is no way to get the path to a dagger.Directory but may be wrong

#

So after searching a bit more, I see a dagger.Directory is just a snapshot - I think after using WithDirectory I can specify a mount point and from there run any code that needs access

timid olive