Skip to content

Commit

Permalink
add Makefile with instructions on how to start MS SQL server for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbrainman committed Sep 25, 2017
1 parent 941a463 commit 27e92ea
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

DB_FILES=/tmp/mssql_temp
CONTAINER_NAME=mssql_test
SA_PASSWORD=Passw0rd
DB_NAME=test

help:
echo "use start or stop target"

start:
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
sleep 10
docker exec mssql_test /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '$(SA_PASSWORD)' -Q 'create database $(DB_NAME)'

stop:
docker stop $(CONTAINER_NAME)
docker rm $(CONTAINER_NAME)

0 comments on commit 27e92ea

Please sign in to comment.