Skip to content

Commit dded749

Browse files
committed
doc fixes
1 parent 474e02b commit dded749

File tree

8 files changed

+44
-59
lines changed

8 files changed

+44
-59
lines changed

4-run-dev-image.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ docker run --name 'sqldocker-dev' --cap-add SYS_PTRACE \
1414
-d mcr.microsoft.com/mssql/server:2017-latest
1515

1616
docker ps
17+

5-create-script-dev-db.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
22
#
3-
# Use mssql-scripter to generate SQL script to extract schema + data of the 'Customer' table
3+
# Use mssql-scripter to generate SQL script to extract schema + data only for the "Customer" table
44
# Note that we're using the 'scripter' user for whom the data is masked
55
#
66

77
set -x
88
DBNAME="AdventureworksLT"
99

10-
# Generate script with schema + data from pre-production image 'sqldocker'
10+
# Connect to source Docker container (sqldocker) and generate script with schema + data for "Customer" table
1111
mssql-scripter -S 127.0.0.1 -U scripter -P Yukon900 -d $DBNAME \
1212
--schema-and-data \
1313
--script-create \
@@ -16,7 +16,7 @@ mssql-scripter -S 127.0.0.1 -U scripter -P Yukon900 -d $DBNAME \
1616

1717
cat ./create-customer.sql | more
1818

19-
# Create database and schema
19+
# Connect to target Docker container (sqldocker-dev) and create database and schema
2020
sqlcmd -S 127.0.0.1,1432 -U sa -P Yukon900 -Q "CREATE DATABASE $DBNAME"
2121
sqlcmd -S 127.0.0.1,1432 -U sa -P Yukon900 -d $DBNAME -Q "CREATE SCHEMA [SalesLT]"
2222

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
This repo has the ***demo scripts*** and ***talking points*** for the ***SQL Server in Docker*** demos presented to the STRAPS team in Salesforce Marketing Cloud, May 2019.
66

77
Jump to:
8-
- [Demo Setup](https://github.com/sanagama/sqldemo-docker/blob/master/demo-setup.md)
98
- [Demo Script](https://github.com/sanagama/sqldemo-docker/blob/master/demo-script.md)
109

1110
## Prerequisites
@@ -16,3 +15,32 @@ These are the prerequisites to run this demo:
1615
- A MacBook (or other computer)
1716
- Azure Data Studio
1817
- Docker
18+
19+
## Demo Setup
20+
21+
Perform these steps ***once*** on your computer:
22+
23+
### Setup MacBook
24+
25+
1. Install *Python* and *pip* on your MacBook. Here's a great guide for macOS: <https://hackercodex.com/guide/python-development-environment-on-mac-osx>
26+
1. Download and install Azure Data Studio for MacOS from here: <https://docs.microsoft.com/en-us/sql/azure-data-studio/download>
27+
1. Install the *mssql-scripter* commands line tool as described here: <https://github.com/Microsoft/sql-xplat-cli/blob/dev/doc/installation_guide.md>
28+
1. Install *mssql-tools* for macOS as described here: <https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools#macos>
29+
1. Install the *mssql-cli* command line tool as described here: <https://docs.microsoft.com/en-us/sql/tools/mssql-cli>
30+
1. Browse to <https://github.com/sanagama/sqldemo-docker>
31+
1. Click ```Clone or Download``` then click ```Download ZIP```
32+
1. Save the ZIP file to your ```HOME``` directory
33+
1. Extract the zip file to ```~/sqldemo-docker```
34+
35+
### Setup Docker
36+
37+
Download Docker for your operating system and complete the installation:
38+
- [Docker for Mac](https://www.docker.com/docker-mac)
39+
- [Docker for Windows](https://www.docker.com/docker-windows)
40+
41+
Increase Docker memory to 4 GB as documented here:
42+
<https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker#requirements>
43+
44+
45+
## Congrats! You have completed the one-time demo setup!
46+

backups/restore-adventureworks.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ GO
1919
-- Dump database names
2020
SELECT NAME FROM SYS.DATABASES
2121
GO
22+

backups/restore-wwi.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
55

66
# run sqlcmd inside the Docker container to restore WideWorldImporters
77
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Yukon900 -i /backups/restore-wwi.sql
8+
9+

backups/restore-wwi.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ GO
2020
-- Dump database names
2121
SELECT NAME FROM SYS.DATABASES
2222
GO
23+

demo-script.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
This page has the ***demo scripts*** and ***talking points*** for the ***SQL Server in Docker*** demos presented to the STRAPS team in Salesforce Marketing Cloud, May 2019.
66

77
Jump to:
8-
- [Main README.md](https://github.com/sanagama/sqldemo-docker)
9-
- [Demo Setup](https://github.com/sanagama/sqldemo-docker/blob/master/demo-setup.md)
8+
- [README.md](https://github.com/sanagama/sqldemo-docker)
109

1110

1211
## Demo Script
@@ -19,7 +18,7 @@ Jump to:
1918
1. [Create dev environment](#4-create-dev-environment)
2019
1. [Share container](#5-share-container)
2120

22-
#### SQL in Docker Intro
21+
### SQL in Docker Intro
2322

2423
(**Talking Points**)
2524
- Let me talk a bit about running SQL in Docker.
@@ -39,7 +38,7 @@ Running SQL Server in Docker gives you 3 major benefits:
3938

4039
Let's start
4140

42-
#### 1. Run SQL in Docker
41+
### 1. Run SQL in Docker
4342

4443
Launch a ```Terminal``` window and type the following:
4544
```
@@ -67,7 +66,7 @@ cat ./2-run-sqlcmd.sh
6766
(**Talking Points**)
6867
- That was a basic demo of SQL Server in Docker
6968

70-
#### 2. Restore a database backup
69+
### 2. Restore a database backup
7170

7271
(**Talking Points**)
7372
- Let's try restoring a backup of the ```Wide World Importers``` database to SQL running in Docker
@@ -82,7 +81,7 @@ cat ./3-restore-db.sh
8281
./3-restore-db.sh
8382
```
8483

85-
#### 3. Create pre-production environment
84+
### 3. Create pre-production environment
8685

8786
(**Talking Points**)
8887
- Let's do something more interesting
@@ -109,7 +108,7 @@ Talk to each statement as you execute it.
109108
- Next problem: this is the full database but you only needs the ```Customer``` table.
110109
- Let's see how we can address that
111110

112-
#### 4. Create dev environment
111+
### 4. Create dev environment
113112

114113
(**Talking Points**)
115114
- My ```sqldocker``` Docker image is still running
@@ -162,7 +161,7 @@ Switch back to Azure Data Studio.
162161
- Our dev environment is ready!
163162
- Now, how can we share these environments with the rest of the team?
164163

165-
#### 5. Share container
164+
### 5. Share container
166165

167166
(**Talking Points**)
168167
- We can easily push these images to Docker hub for others to use

demo-setup.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)