Skip to content

Commit 27e92ea

Browse files
committed
add Makefile with instructions on how to start MS SQL server for testing
1 parent 941a463 commit 27e92ea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
DB_FILES=/tmp/mssql_temp
3+
CONTAINER_NAME=mssql_test
4+
SA_PASSWORD=Passw0rd
5+
DB_NAME=test
6+
7+
help:
8+
echo "use start or stop target"
9+
10+
start:
11+
docker run --name=$(CONTAINER_NAME) -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=$(SA_PASSWORD)' -e 'MSSQL_PID=Developer' --cap-add SYS_PTRACE -v $(DB_FILES):/var/opt/mssql -d -p 1433:1433 microsoft/mssql-server-linux
12+
sleep 10
13+
docker exec mssql_test /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '$(SA_PASSWORD)' -Q 'create database $(DB_NAME)'
14+
15+
stop:
16+
docker stop $(CONTAINER_NAME)
17+
docker rm $(CONTAINER_NAME)

0 commit comments

Comments
 (0)