docker environment variable during debug

Alen Cappelletti 1,047 Reputation points
2023-01-04T15:45:25.573+00:00

Hi all,

I' specify right away that I'm a novice in the use of visual studio...
but I'm trying to understand how an app that I inherited and that I'm porting to a docker works.

In my project I have a settings.env file in which I have defined 6 environment variables (for docker):

SSE_CONNECTIONS=config/connections.json  
SSE_SQL=config/sql.json  
SSE_ADHOC=config/adhoc.json  
SSE_ACTIVE_WAIT_STATS=false  
SSE_ACTIVE_WORKER_THREAD=false  
SSE_ACTIVE_MEMORY_CLERKS=false  

  <PropertyGroup>  
    <Nullable>enable</Nullable>  
    <Company />  
    <UserSecretsId>149a9c60-49ec-4dd4-86e1-6d8720f51f11</UserSecretsId>  
    <PackageReadmeFile>README.md</PackageReadmeFile>  
    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>  
    <DockerfileContext>.</DockerfileContext>  
    <DockerfileRunEnvironmentFiles>settings.env</DockerfileRunEnvironmentFiles>  
  </PropertyGroup>  

If I click debug with Docker
276201-image.png

I see all vars ok when I click on "RUN DOCKER"
but it's not clear to me the config inside when it overwrite my settings.env file.

276110-image.png

I thought debug would override the values expressed in the file instead it always seems to prevail the last ones. But If I delete the file and every reference in the project even if I do PLAY on DOCKER I don't see the variables anyway.

Could you explain me?

THANK YOU, ALEN

Developer technologies .NET Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.