Using Docker to Run MSSQL Image

Finally, we are here..

Using Docker Command

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Atalces!1" -p 1433:1433 --name sqlserver2 -d -h sqlserver microsoft/mssql-server-windows-developer:latest-14393 

docker will pull the mssql image with the version latest-14393

Only this patch can match our vm's OS version and run process-isolation type of container

After 30 seconds, run the command docker ps

CONTAINER ID        IMAGE                                                   COMMAND                  CREATED
 STATUS                    PORTS                    NAMES
55c3dffeeffb        microsoft/mssql-server-windows-developer:latest-14393   "powershell -Command…"   34 hours ago
 Up 38 seconds (healthy)   0.0.0.0:1433->1433/tcp   sqlserver2

Run docker exec -it <sql_container_name> sql and we can execute sql command inside the image.

Last updated

Was this helpful?