Created
December 4, 2020 17:49
-
-
Save vanessaidenny/0966b3aab3af32fbdea1c74612f8cb1c to your computer and use it in GitHub Desktop.
MSSQL Reference - Docker Container and Install AdventureWorks 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
# 1. Run the MSSQL container on the Docker: | |
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong!Passw0rd>" --name "sql" -p 1433:1433 -v sqldata:/var/opt/mssql -d mcr.microsoft.com/mssql/server:2017-latest | |
# 2. Restore AdventureWorks2017 database: | |
# create the backup folder on data volume container | |
docker exec -it sql mkdir /var/opt/mssql/backup | |
# download the AdventureWorks file | |
curl -OutFile "AdventureWorks2017.bak" "https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2017.bak" | |
# copy the AdventureWorks file into the backup folder | |
docker cp AdventureWorks2017.bak sql:/var/opt/mssql/backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment