Pull down the SQL Server Docker Image from DockerHub
docker pull microsoft/mssql-server-linux:2017-latest
Create a Docker container using the microsoft/mssql-server-linux:2017-latest
Automatically accept the EULA, set the password to for the sa user, and map port container port 1433 to host port 1433
docker run --name sql \
-e 'ACCEPT_EULA=Y' \
-e 'SA_PASSWORD=' \
-p 1433:1433 \
-d microsoft/mssql-server-linux:2017-latest
Check if the container is up (running) – in STATUS column
sudo docker ps -a
To stop the container (assuming its name is “sql”) just type
docker stop sql
Now, typing sudo docker ps -a
the container STATUS is Exited
To restart the container just type
docker start sql
Test the connection with Azure Data Studio or SQLPro for MSSQL
Here there is a Microsoft Reference Guide on Docker
Deletes pulled images with IMAGE ID 810001cb03af
docker images | grep 810001cb03af | awk '{print $1 ":" $2}' | xargs docker rmi