#Chaining custom functions that mutate a container

1 messages · Page 1 of 1 (latest)

fast basin
#

Is it possible to define a custom function which takes a container as a piped-in argument and returns a new container?

I tried:

func (m *Xs) WithExtras( ctx context.Context, base *dagger.Container) *dagger.Container {
    return base.WithExec([]string{"echo", "Additional steps can be added here"})
}

but get:

~/s/03d..x3n/xs $ dagger -c 'container | from alpine | with-extras'
▶ connect 1.8s
▶ detect module: . 1.3s
▶ load module: /Users/andy/s/03d9su9iub5xv0xtmyhulbx3n/xs 5.2s                                                                                                                                                                                                                                                                                                                            Full trace at https://dagger.cloud/cross-stream/traces/454724e2c7f21fd686546177d3984da9
Error: no function "with-extras" in type "Container"
~/s/03d..x3n/xs $