I'm trying to run SQL Server Express in a Docker container.
When I run docker container run -d -P my-db:v1
it immediately stops.
The Docker file:
# escape=`
FROM microsoft/mssql-server-windows-express
ENV ACCEPT_EULA="Y" `
DATA_PATH="C:data" `
sa_password="mypw"
VOLUME ${DATA_PATH}
WORKDIR C:folder1
When I remove the WORKDIR
line at the end, the container keeps running.
When including the WORKDIR
line and running the container, Docker Desktop shows:
.start : The term '.start' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:76
+ ... e = 'Stop'; $ProgressPreference = 'SilentlyContinue'; .start -sa_pas ...
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (.start:String) [], ParentConta
insErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException
When I inspect the container, it shows the startup command which looks ok:
"Path": "powershell",
"Args": [
"-Command",
"$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';",
".\start -sa_password $env:sa_password -ACCEPT_EULA $env:ACCEPT_EULA -attach_dbs \"$env:attach_dbs\" -Verbose"
]
question from:
https://stackoverflow.com/questions/65872273/mssql-server-windows-express-docker-container-stops-immediately 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…