Microsoft SQL Server on Linux with powershell support and attach_dbs json environment variable
337
Linux version of powershell script https://github.com/Microsoft/mssql-docker/blob/master/windows/mssql-server-windows-express/start.ps1
attach_dbs: The configuration for attaching custom DBs (.mdf, .ldf files).
This should be a JSON string, in the following format (note the use of SINGLE quotes!)
[
{
'dbName': 'MaxDb',
'dbFiles': ['C:\\temp\\maxtest.mdf',
'C:\\temp\\maxtest_log.ldf']
},
{
'dbName': 'PerryDb',
'dbFiles': ['C:\\temp\\perrytest.mdf',
'C:\\temp\\perrytest_log.ldf']
}
]
This is an array of databases, which can have zero to N databases.
Each consisting of:
dbName: The name of the database
dbFiles: An array of one or many absolute paths to the .MDF and .LDF files.
Note: The path has double backslashes for escaping! The path refers to files within the container. So make sure to include them in the image or mount them via -v!
Attach databases from attach_dbs environment variable
Supports "CHECK_POLICY=OFF" for sa password (SA_NO_POLICY_PASSWORD variable)
MAX_MEMORY variable
Enabled CLR
This example shows all parameters in action:
docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password=<YOUR COMPLEX PASSWORD> -e SA_NO_POLICY_PASSWORD =<SIMPLE SA PASSWORD> -e ACCEPT_EULA=Y -e attach_dbs="[{'dbName':'SampleDB','dbFiles':['C:\\temp\\sampledb.mdf','C:\\temp\\sampledb_log.
ldf']}]" -MAX_MEMORY 1024 microsoft/mssql-server-windows-express
Content type
Image
Digest
Size
572.6 MB
Last updated
over 6 years ago
docker pull multiclubes/mssql