Skip to content

Quick Start Explained

Andrew Pruski edited this page Jul 21, 2020 · 1 revision

For the quick start, we ran the following: -

docker container run -d -p 1433:1433 `
--env ACCEPT_EULA=Y `
--env MSSQL_SA_PASSWORD=Testing1122 `
--name sqlcontainer1 `
mcr.microsoft.com/mssql/server:2019-latest

Let's go through this docker container run statement line by line, starting with: -

docker container run -d

This is saying that we want to run a container in the background (the -d) so that we can continue using our shell.

Next we map some ports: -

 -p 1433:1433

What this does is map port 1433 on the host (our laptop) to port 1433 within our container. This allows us to use localhost in SSMS or ADS to connect to SQL running within the container.

Now we specify a couple of environment variables: -

--env ACCEPT_EULA=Y
--env MSSQL_SA_PASSWORD=Testing1122

This accepts the SQL end user license agreement, which has to be done for each container spun up running SQL Server, and sets the password for the SA account to Testing1122. This is needed as Windows authentication is not supported for SQL running in a container.

Then we give our container a name: -

--name sqlcontainer1

And finally specify the image that we want to spin the container up from: -

 mcr.microsoft.com/mssql/server:2019-latest

This is going to pull down the latest SQL Server 2019 container running on Ubuntu (if it is not already present on the host).