Archive

Archive for the ‘Docker’ Category

Simple Guide to Run SQL Server 2017 in Docker (Linux Containers)

October 17, 2017 Leave a comment

SQL Server 2017 is now supported in Windows, Linux and Docker platform

In previous posts, we saw

How to upgrade SQL Server 2017 on Ubuntu Linux to RTM Version

Simple Guide to provision SQL Server 2017 on Linux in Azure VM

In this post, we will see How to download and run SQL Server 2017 in Docker using Linux Containers

Step 1: Verify and Configure Docker Memory Settings, By default Docker is installed with 2 GB as Configured Memory usage, but SQL Server 2017 needs Min 4 GB RAM

capture20171016150708586

Step 2: Open Powershell and run below command to check the current Docker images

docker ps

capture20171016150842105

Currently we don’t have any images

Step 3: Run below command to download SQL Server 2017 Docker image

docker pull microsoft/mssql-server-linux:2017-latest

Depending on the internet speed, the download will take time

capture20171016151010165

You can verify the downloaded images by running below command

docker images

capture20171016152600162

Step 4: Run below command to start the Docker image and configure SQL Server 2017

docker run -e “ACCEPT_EULA=Y” -e “MSSQL_SA_PASSWORD=<YourStrong!Passw0rd>” -p 1401:1433 –name sql1 -d microsoft/mssql-server-linux:2017-latest

Please change the Name, Port and Password as per your requirements, once the container is started, Please run below command to check the status of container

docker ps

We can see the container is up and running

capture20171016155801340

Please launch Management Studio and connect to docker container by using the IP Address:Port, since its local machine, we will be using localhost,1401

capture20171016155652675

Please run below SQL Command to verify the version of SQL Server

SELECT @@VERSION 

capture20171016155825915

Please run below SQL Command to check the Server name and OS Info

SELECT @@SERVERNAME [ServerName],
host_platform,
host_distribution,
host_release,
host_service_pack_level,
host_sku,
os_language_version
FROM   sys.dm_os_host_info 

capture20171016155846732

Please note that Server name will be the Container ID and not the Container name

Hope you find this post helpful !!!

Advertisements
%d bloggers like this: