Parameterizing web.config, etc.
In the web.config of a given ASP.NET app, the a connection string is often hardcoded. How can this be parameterized such that we can maintain a single image, but pass DB server name, DB name, and credentials to the container at docker run time? I was thinking of adding a PS script to the image which gets invoked via CMD or ENTRYPOINT, and have that script accept parameters from docker run, which would update web.config. Just curious as to what best practice is here. I have similar concerns for the registry, SSL certificates, etc.
Environment variables when you launch container.
I would got with enviroment variables set in the dockerfile, this way when you call the script in the ENTRYPOINT or in the final CMD file you will be able to push the variables just set. I think worth the case to look at the way the MSSQL images are create in github to get a good idea. https://github.com/Microsoft/mssql-docker/blob/master/windows/mssql-server-windows-developer/dockerfile
I would got with enviroment variables set in the dockerfile, this way when you call the script in the ENTRYPOINT or in the final CMD file you will be able to push the variables just set. I think worth the case to look at the way the MSSQL images are create in github to get a good idea. https://github.com/Microsoft/mssql-docker/blob/master/windows/mssql-server-windows-developer/dockerfile My understanding the point to make this to be runtime variable which will not be accessible anywhere outside of running environment. If you put them it in docker file it bakes this into the image.
I'm not exactly sure what your goal is, so if you can describe that a bit more that would help. Here are some resources in the meantime: http://stackoverflow.com/questions/30494050/how-to-pass-environment-variables-to-docker-containers http://staxmanade.com/2016/05/how-to-get-environment-variables-passed-through-docker-compose-to-the-containers/ https://github.com/docker/docker/issues/240 https://docs.docker.com/docker-cloud/getting-started/deploy-app/6_define_environment_variables/#environment-variables-and-the-dockerfile https://docs.docker.com/compose/environment-variables/#the-envfile-configuration-option
Virtualbox not works after install Docker
Nanoserver container not working with TP5
DTC in container
problems with mount full driver for the container
Does anybody ssh to a windows container?
Windows container docker pull fails.
Error Looking at Container Network.
how to call the docker daemon in Azure VM Windows Server 2016 TP5 from a client docker on windows 10
Github container example for apache produces non-zero code 255 on TP5
TP5 Unable to run windowsservercore with docker native command
Hyper-V Error - the operation cannot be performed while the object is in its current state
Remote debugging of C++ applications using visual studio inside container
Static IP Addresses: Constraints related to NAT networks
Can I do anything right now to get Visual Studio to deploy to a windows container?
Get-EventLog inside container - InvalidOperationException
Trouble Collection TP 5