#dagger.json exclude
1 messages · Page 1 of 1 (latest)
Yes! Dagger needs to upload the module's directory in order to load it (passed to the runtime module via the
modSource *ModuleSource argument). If there isn't any exclude in dagger.json it'll upload everything from the directory where dagger.json is, no matter the depth.
It doesn't take .gitignore into consideration.
Got a JSON example for me to use? For exclude
I'm not sure that's true, I thought we had sane include/exclude defaults for module load? @quaint sparrow
Not really, we don't yet. Not for the source directory at least. We only default to exclude **/.git from the context directory, and make sure to include dagger.json and the source directory (maybe it's the root dir). Additionally, SDKs can define more patterns to include (but not exclude), relative to context, and only Go uses it.
Default include/exclude for all SDKs: https://github.com/dagger/dagger/blob/f9fd2993f5a96b3bb95f7559e810aafbd50cdd99/core/schema/modulesource.go#L751-L755
Default includes for Go SDK: https://github.com/dagger/dagger/blob/f9fd2993f5a96b3bb95f7559e810aafbd50cdd99/core/schema/sdk.go#L404-L417