Tip
If you are debugging with VS2017/9 and want to pass environment variables to your container then read this post, if you are looking for picture of cats then sorry but leave a comment how you got here
Step 1
Create a new text file, the name doesn’t matter, but i called mine Dockerfile.env
Step 2
Add this file to your .csproj file.
Step 3
Not really a step but you you can simply query your Environment variable in the usual fashion (Environment.GetEnvironmentVariable())
Note:
Needless to say when you run in production you’ll need to pass the Environment variable according to Docker documentation which I don’t cover here