title: How can I provide application config to my .NET Core Web API services running in docker containers?
body: <p>I am using Docker to deploy my ASP.NET Core Web API microservices, and am looking at the options for injecting configuration into each container.  The standard way of using an appsettings.json file in the application root directory is not ideal, because as far as I can see, that means building the file into my docker images, which would then limit which environment the image could run in.</p>
  
  <p>I want to build an image once which can they be provided configuration at runtime and rolled through the dev, test UAT and into Production without creating an image for each environment.</p>
  
  <p>Options seem to be:</p>
  
  <ol>
  <li>Providing config via environment variables.  Seems a bit tedious.</li>
  <li>Somehow mapping a path in the container to a standard location on the host server where appsettings.json sits, and getting the service to pick this up (how?)</li>
  <li>May be possible to provide values on the docker run command line?</li>
  </ol>
  
  <p>Does anyone have experience with this?  Could you provide code samples/directions, particularly on option 2) which seems the best at the moment?</p>