Created
March 22, 2020 10:42
-
-
Save efleming969/48ddc68e780b17552e12eb0bed9d404e to your computer and use it in GitHub Desktop.
PowerShell script to start and create docker database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$db_password="P@ssw0rd" | |
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=$db_password" ` | |
-p 1433:1433 -d --name mssql` | |
mcr.microsoft.com/mssql/server:2017-CU8-ubuntu | |
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd ` | |
-S localhost -U sa -P $db_password ` | |
-Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = N'Radio') BEGIN CREATE DATABASE [Radio] END;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment