Hi everyone,
I've noticed that after v0.18.3, an error occurs when I build a container from a Dockerfile and pass it to a function from another module.
Example:
Main module:
// Create a base container that builds from a Dockerfile
func (m *NotWorking) BaseContainer() *dagger.Container {
return dag.Container().Build(
dag.CurrentModule().Source().Directory("."),
dagger.ContainerBuildOpts{
Dockerfile: "./nw.Dockerfile",
})
}
// Call a function from the other module
func (m *NotWorking) SayHello(ctx context.Context) string {
ctr := m.BaseContainer()
out, err := dag.OtherModule().ContainerEcho(ctr).Stdout(ctx)
if err != nil {
return "Error calling OtherModule: " + err.Error()
}
return out
}
Then, OtherModule has the function defined like this:
func (m *OtherModule) ContainerEcho(ctr dagger.Container) *dagger.Container {
return ctr.WithExec([]string{"echo", "Hello, World!"})
}
When I run this using dagger call -m git@github.com:JCastillo07/dagger_example.git/not-working@main say-hello it only works for versions < v0.18.3
Here's the error I see when using SSH:
unexpected status 200: get or init client: initialize client: failed to add client resources from ID: failed to add socket from source client ru9q6qk65gncr9d1oerdvyjz8: socket xxh3:e0d8b8180e297a69 not found in other store
failed to return error: get or init client: initialize client: failed to add client resources from ID: failed to add socket from source client ru9q6qk65gncr9d1oerdvyjz8: socket xxh3:e0d8b8180e297a69 not found in other store
original error: get parent name: get or init client: initialize client: failed to add client resources from ID: failed to add socket from source client ru9q6qk65gncr9d1oerdvyjz8: socket xxh3:e0d8b8180e297a69 not found in other store
Here's the public repo with the example to reproduce this error: https://github.com/JCastillo07/dagger_example
Thanks!