I'm trying to build a Container and the Dockerfile needs a cluster secret to build (NPM_TOKEN to contact a private repo). So how can I inject secrets into a container build? The documentation link for Build -> Container on the docker.io site appears to not be working so I'll take any help here instead. I've tried
hoping one might work but no luck. TIA!
06/15/2023, 8:24 PM
Hey! @eager-yacht-45658, just one question are you using 0.13 or Acorn? Just to provide a more accurate solution.
First thing you’ll need is add an ARG in the Dockerfile that accepts the NPM_TOKEN as an argument.
Then Garden moduled have a field called
I would suggest using it that way so you don’t accidentally commit the token to your repo
06/16/2023, 11:51 AM
@bright-policeman-43626 thanks - using 0.13 - and I understand that part; how do i get a secret to set the value of NPM_TOKEN during the build step?
06/16/2023, 12:46 PM
You can export it on your bash profile by using export NPM_TOKEN=your-token
And then use the buildArgs block!
06/16/2023, 4:29 PM
^ excellent @bright-policeman-43626 thank u!
06/16/2023, 4:30 PM
Please let me know if that fixed the issue!
In Bonsai you can find buildArgs under .spec in the Build action