title: how to set the environment of dotnet core in docker?
body: <p>I want to be able to run dotnet core by docker in different environments(for now just development and production) but my docker always start in production environment.
  here is my docker file:</p>
  
  <pre><code>FROM microsoft/dotnet:sdk AS build-env
  
  WORKDIR /app
  
  # Copy csproj and restore as distinct layers
  COPY *.csproj ./
  RUN dotnet restore
  
  # Copy everything else and build
  COPY . ./
  RUN dotnet publish -o out
  
  # Build runtime image
  FROM microsoft/dotnet:aspnetcore-runtime
  WORKDIR /app
  COPY --from=build-env /app/out .
  ENTRYPOINT ["dotnet", "test.dll"]
  </code></pre>
  
  <p>I have appsettings.Production.json and appsettings.Development.json
  and I have configured my two environments in program.cs like below:</p>
  
  <pre><code> public static IWebHostBuilder CreateWebHostBuilder (string[] args) =&gt;
              WebHost.CreateDefaultBuilder (args)
  
              .ConfigureAppConfiguration ((hostingContext, config) =&gt; {
                  config.AddJsonFile ("appsettings.Development.json", optional : false, reloadOnChange : false)
                      .AddJsonFile ("appsettings.Production.json", optional : false, reloadOnChange : false);
              })
              //End of update
              .UseStartup&lt;Startup&gt; ();
  </code></pre>
  
  <p>I build the docker image and container but when it starts it starts in production mode I want it to start in development mode</p>