How to set env variables in Docker reliably
I want to deploy my backend (or really all my programs) using Kubernetes / CircleCI and now im facing the issue of wanting to have my credentials and such set as environment variables for my Image on deploy
My current structure is something like: program starts -> generates config files -> reads config files
Now with the config files being waited for to get filled in it kinda destroys the point of automatic deployment, and me using SQLite as database doesnt help either considering it would be gone each time
TLDR;
So how can i reliably pass Environment variables for credentials like that into my Image on deploy
5 Replies
whatever you're using on the host to run the container should set those env vars
how can i pass the arguments into the container from visual studio to test it?
looks like you can do this https://melcher.dev/2019/01/til-set-docker-environment-variables-in-visual-studio-for-easier-debugging/
TIL: Set Docker Environment Variables in Visual Studio for easier d...
Today I learned how to set Docker Environment Variables directly in Visual Studio to ease my debugging experience.
but I would instead recommend https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets
Safe storage of app secrets in development in ASP.NET Core
Learn how to store and retrieve sensitive information during the development of an ASP.NET Core app.
provided you're using the .net config system that is
the one you get when you make a web api or worker service