Skip to content

Commit 919362c

Browse files
author
Max Knor
committed
Added additional comments to readme.md
1 parent 2188003 commit 919362c

File tree

1 file changed

+33
-5
lines changed
  • samples/manage/windows-containers/mssql-server-2014-express-windows

1 file changed

+33
-5
lines changed

samples/manage/windows-containers/mssql-server-2014-express-windows/readme.md

+33-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Note: This dockerfile is based on Buc Rogers' work that can be found [here] (htt
1717
## About this sample
1818

1919
1. **Applies to:** SQL Server 2014 Express, Windows Server Technical Preview 4 or later
20-
5. **Authors:** Perry Skountrianos [perrysk-msft]
20+
5. **Authors:** Perry Skountrianos [perrysk-msft], Max Knor [knom]
2121

2222
<a name=before-you-begin></a>
2323

@@ -27,16 +27,44 @@ To run this sample, you need the following prerequisites.
2727

2828
**Software prerequisites:**
2929

30-
You can run the container with the following command. Note the you'll need Windows Server Core TP5 v10.0.14300.1000.
31-
docker run -p 1433:1433 --env sa_password=<YOUR SA PASSWORD> microsoft/mssql-server-2014-express-windows
30+
You can run the container with the following command.
31+
(Note the you'll need Windows Server Core TP5 v10.0.14300.1000.)
32+
33+
````
34+
docker run -p 1433:1433 -v C:/temp/:C:/temp/ --env sa_password=<YOUR SA PASSWORD> --env attach_dbs="<DB-JSON-CONFIG>" -v microsoft/mssql-server-2014-express-windows
35+
````
36+
37+
- **-p HostPort:containerPort** is for port-mapping a container network port to a host port.
38+
- **-v HostPath:containerPath** is for mounting a folder from the host inside the container.
39+
40+
This can be used for saving database outside of the container.
3241

3342
<a name=run-this-sample></a>
3443

3544
## Run this sample
3645

37-
The image provides one environment variable to set the sa password: </br>
46+
The image provides two environment variables to optionally set: </br>
3847
- sa_password: Sets the sa password and enables the sa login
39-
48+
- attach_dbs: The configuration for attaching custom DBs (.mdf, .ldf files).
49+
50+
This should be a JSON string, formed like the following (note the SINGLE quotes and everything in one line):
51+
```
52+
[{'dbName':'MaxDb','dbFiles':['C:\\temp\\maxtest.mdf','C:\\temp\\maxtest_log.
53+
ldf']},{'dbName':'PerryDb','dbFiles':['C:\\temp\\perrytest.mdf','C:\\temp\\perrytest_log.
54+
ldf']}]
55+
```
56+
There can be zero to many databases in the array.
57+
- dbName: The name of the database
58+
- dbFiles: An array of absolute paths to the .MDF and .LDF files.
59+
60+
Can be one or many, note that the path has double backslashes for escaping!
61+
62+
This example shows all parameters in action:
63+
```
64+
docker run -p 1433:1433 -v C:/temp/:C:/temp/ --env attach_dbs="[{'dbName':'MaxTest','dbFiles':['C:\\temp\\maxtest.mdf','C:\\temp\\maxtest_log.
65+
ldf']}]" sqlexpr
66+
```
67+
4068
<a name=sample-details></a>
4169

4270
## Sample details

0 commit comments

Comments
 (0)