microsoft/mssql-server-linux
with the one you downloaded.-d | This optional parameter launches the Docker container in daemon mode. This means that it runs in the background and doesn’t need its own Terminal window open. You can omit this parameter to have the container run in its own Terminal window. |
--name sql_server_demo | Another optional parameter. This parameter allows you to name the container. This can be handy when stopping and starting your container from the Terminal. |
-e 'ACCEPT_EULA=Y' | The Y shows that you agree with the EULA (End User Licence Agreement). This is required in order to have SQL Server for Linux run on your Mac. |
-e 'SA_PASSWORD=reallyStrongPwd123' | Required parameter that sets the sa database password. |
-p 1433:1433 | This maps the local port 1433 to port 1433 on the container. This is the default TCP port that SQL Server uses to listen for connections. |
microsoft/mssql-server-linux | This tells Docker which image to use. If you downloaded a different one, use it instead. |
reallyStrongPwd
as the password (but of course, it’s not a really strong password!). I was able to overcome this by adding some numbers to the end. However, if it wasn’t just a demo I’d definitely make it stronger than a few dictionary words and numbers.Please try running this command again as root/Administrator, try again, but this time prepend
sudo
to your command:mssql
command, followed by the username and password parameters.Bart
to a name of your choosing, and reallyStrongPwd#123
to a password of your choosing.-e 'ACCEPT_EULA=Y'
Y
shows that you agree with the EULA (End User Licence Agreement). This is required.-e 'SA_PASSWORD=reallyStrongPwd#123'
sa
database password.-p 1433:1433
--name Bart
sql_server_2019
or similar.-d
mcr.microsoft.com/mssql/server:2019-CTP3.2-ubuntu
The password should follow the SQL Server default password policy, otherwise the container can not setup SQL server and will stop working. By default, the password must be at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols.
-p 1433:1433
to -p 1400:1433
. Everything else remains the same.Bart
with the name of your own container):Localhost,1400
instead of just Localhost
. Same with mssql-cli, which is a command line SQL tool.