About
docker image of SQL Server
Articles Related
List
- Official Microsoft SQL Server Developer Edition images]] for Windows Containersmicrosoft/mssql-server-windows-developer
- SQL Server Express for Windows Containers: microsoft/mssql-server-windows-express
- SQL Server on Linux for Docker Engine: microsoft/mssql-server-linux
Management
The below statements use the SQL Server on Linux for Docker Engine: microsoft/mssql-server-linux
Create a container
- Bash
docker run \
-e 'ACCEPT_EULA=Y' `#Accept the license term` \
-e 'SA_PASSWORD=TheSecret1!' `#Strong password at least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols. ` \
-p 1433:1433 \
-d `# Daemon` \
--name sqlserver `#Container Name` \
microsoft/mssql-server-linux:2017-latest
- Dos
docker run ^
-e "ACCEPT_EULA=Y" ^
-e "SA_PASSWORD=TheSecret1!" ^
-p 1433:1433 ^
-d ^
--name sqlserver ^
microsoft/mssql-server-linux:2017-latest
Start, stop the container
docker start mssql_server
docker stop mssql_server
Connect
docker exec \
-it mssql_server \
/opt/mssql-tools/bin/sqlcmd \
-S localhost \
-U sa \
-P TheSecret1!