#using dagger.Host().EnvVariable("FOO")
1 messages · Page 1 of 1 (latest)
it'll probably be removed soon. it was added so we could support loading env vars as secrets, but there's a new secrets api now that lets you just do dagger.SetSecret("foo", os.Getenv("BAR")) instead
right, that's what I assumed, thanks 🙌
ohh.. this is so sweet!
sec := client.SetSecret("someToken", os.Getenv("SOME_TOKEN"))
baseImage := client.Container().From(baseImage)
img := baseImage.
WithSecretVariable("SOME_TOKEN", sec)
...
debug(img.WithExec([]string{"env"})) -> SOME_TOKEN=***
Is this in the latest SDK releases?
I'm stuck on a slightly older SDK until Alpine3.17 ships with Python 3.11 or my org updates our base image
I think it was in v0.4.1
That might explain why I've not seen/tried it yet
@rigid turtle and @modern tide are working on a new secrets guide now