Closed dropsonic closed 5 years ago
You have two problems with your approach. First one is myImage needs to come last, after the environment variables. You also need double quotes around your connection string as it has spaces. This has worked successfully on my machine:
docker run -p 8085:80 --name test1 -e CONNECTION_STRING="Data Source=(local);Initial Catalog=mydb;User Id=sa;Password=mypass" myimage
Since I tracked this down I thought I'd share... ServiceMonitor by default starts DefaultAppPool, if you delete the defaultAppPool and intend to use a different name, then you get this error. To solve it/workaround you need to pass the correct app pool name... Yeah, after spending 40 minutes on this I ran the command with no arguments and had my answser.
USAGE: C:\ServiceMonitor.exe [windows service name]
C:\ServiceMonitor.exe w3svc [application pool]
Options:
windows service name Name of the Windows service to monitor
application pool Name of the application pool to monitor; defaults to DefaultAppPool
I have a very simple image with ASP.NET application:
I create a container with this command:
docker run -p 8085:80 --name test1 myimage -e CONNECTION_STRING='Data Source=(local);Initial Catalog=mydb;User Id=sa;Password=mypass'
But it immediately stops with the following error:
Please advise why I receive this error.