Added additional comments to readme.md

This commit is contained in:
Max Knor
2016-06-21 15:30:12 +02:00
parent 2188003b5f
commit 919362cf60
@@ -17,7 +17,7 @@ Note: This dockerfile is based on Buc Rogers' work that can be found [here] (htt
## About this sample
1. **Applies to:** SQL Server 2014 Express, Windows Server Technical Preview 4 or later
5. **Authors:** Perry Skountrianos [perrysk-msft]
5. **Authors:** Perry Skountrianos [perrysk-msft], Max Knor [knom]
<a name=before-you-begin></a>
@@ -27,16 +27,44 @@ To run this sample, you need the following prerequisites.
**Software prerequisites:**
You can run the container with the following command. Note the you'll need Windows Server Core TP5 v10.0.14300.1000.
docker run -p 1433:1433 --env sa_password=<YOUR SA PASSWORD> microsoft/mssql-server-2014-express-windows
You can run the container with the following command.
(Note the you'll need Windows Server Core TP5 v10.0.14300.1000.)
````
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
````
- **-p HostPort:containerPort** is for port-mapping a container network port to a host port.
- **-v HostPath:containerPath** is for mounting a folder from the host inside the container.
This can be used for saving database outside of the container.
<a name=run-this-sample></a>
## Run this sample
The image provides one environment variable to set the sa password: </br>
The image provides two environment variables to optionally set: </br>
- sa_password: Sets the sa password and enables the sa login
- attach_dbs: The configuration for attaching custom DBs (.mdf, .ldf files).
This should be a JSON string, formed like the following (note the SINGLE quotes and everything in one line):
```
[{'dbName':'MaxDb','dbFiles':['C:\\temp\\maxtest.mdf','C:\\temp\\maxtest_log.
ldf']},{'dbName':'PerryDb','dbFiles':['C:\\temp\\perrytest.mdf','C:\\temp\\perrytest_log.
ldf']}]
```
There can be zero to many databases in the array.
- dbName: The name of the database
- dbFiles: An array of absolute paths to the .MDF and .LDF files.
Can be one or many, note that the path has double backslashes for escaping!
This example shows all parameters in action:
```
docker run -p 1433:1433 -v C:/temp/:C:/temp/ --env attach_dbs="[{'dbName':'MaxTest','dbFiles':['C:\\temp\\maxtest.mdf','C:\\temp\\maxtest_log.
ldf']}]" sqlexpr
```
<a name=sample-details></a>
## Sample details