#dagger init "upload"

1 messages · Page 1 of 1 (latest)

arctic bridge
#

Hey all,

I just wanted some clarification of the "upload" portion of dagger init, specifically when running dagger init --sdk=go <dir> in an existing "project" (i.e. repository) directory. When I saw this initally, I was like, "this shouldn't be uploading anything?" but upon further inspection, it looks like Dagger is just copying the directory contents to a container volume. Is this in fact the case?

Just wanted to make sure the contents weren't being sent from outside the confines of my local environment.

Thanks!

gilded rapids
#

Hey @arctic bridge! You are correct to think that contents never leave your local environment. The uploading step refers to "sending" contents to the dagger engine itself, which should be running as a container in your machine (docker ps to confirm!). You can point to a remote dagger engine using the env variable _EXPERIMENTAL_DAGGER_RUNNER_HOST, in which case the CLI would need to send contents to that engine remotely.

For example, lets say you have a module with a function that expects a directory:

func (m *Mod) Build(ctx context.Context, src *Directory) error {
    ...
}

When you do dagger call build --src "." the dagger CLI needs to "upload" the directory to the container.

When you are doing init, as you can see in the screenshot, the CLI needs to load the context of the local module in the dagger engine: