{"id":14945,"date":"2020-10-31T16:31:24","date_gmt":"2020-10-31T15:31:24","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/"},"modified":"2025-10-01T11:48:21","modified_gmt":"2025-10-01T09:48:21","slug":"getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/","title":{"rendered":"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2"},"content":{"rendered":"<p>In this blog post, I will show you the steps I went through to run SQL Server inside a Linux Docker container on my Windows 10 laptop.<br \/>\nThe aim here is to deploy quickly and easily SQL Server instances in my lab environment.<\/p>\n<h5><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/dockerSQL.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44570 size-medium\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/dockerSQL.png\" alt=\"\" width=\"300\" height=\"185\"><\/a><\/h5>\n<h3>Introduction<\/h3>\n<p>Since May 2020 Windows ships with WSL 2. Windows System for Linux is a feature that creates a lightweight environment that allows you to run Linux distributions (Debian, Ubuntu, etc.) without having to set up a VM or dual-booting. WSL has been around for a while but with WSL 2 the architecture has been reconfigured to run a Linux kernel, adding full system call compatibility and increasing file system performance. You can now run Docker in your Linux distro on Windows with WSL 2.<\/p>\n<p>In this blog post, I decided to install the Docker Engine on Windows with Docker Desktop but you could also install Docker directly on a WSL2 Linux distro.<\/p>\n<p>We will see the following topics<\/p>\n<p style=\"padding-left: 40px\"><strong>&#8211; WSL 2 installation<\/strong><br \/>\n<strong>&#8211; Docker Desktop installation<\/strong><br \/>\n<strong>&#8211; Run a SQL Server container<\/strong><br \/>\n<strong>&#8211; Connect to the SQL Server instance with SSMS<\/strong><br \/>\n<strong>&#8211; Enable the SQL Server Agent<\/strong><br \/>\n<strong>&#8211; Create a custom image<\/strong><br \/>\n<strong> &#8211; Transfert a database backup file<\/strong><\/p>\n<h3>WSL 2 installation<\/h3>\n<p>The <a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wsl-2-support-is-coming-to-windows-10-versions-1903-and-1909\/\">requirement to use WSL 2<\/a> is to have Windows 10 <strong>version 1903<\/strong> or higher with <strong>Build 18362<\/strong> or higher.<\/p>\n<p>So the first thing is to check the windows version and build number. It can be done with PowerShell with <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/microsoft.powershell.management\/get-computerinfo\">Get-ComputerInfo<\/a>.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/00_WinVersion.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44535\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/00_WinVersion.png\" alt=\"\" width=\"700\" height=\"196\"><\/a><\/p>\n<p>Let&#8217;s check if WSL is already enabled:<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44521\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/02_FeatureWSL_Disabled.png\" alt=\"\" width=\"700\" height=\"121\"><\/p>\n<p>You can enable it using the command below (in an administrative PowerShell). You will have to restart your computer after that.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/11_EnableWSL-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44541\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/11_EnableWSL-1.png\" alt=\"\" width=\"958\" height=\"222\"><\/a><\/p>\n<p>Once enabled WSL 2 needs to be updated.<br \/>\nTo do so you need to download and run <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/wsl2-kernel\">the latest WSL 2 update package<\/a>.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/12_WSL_update.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44542\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/12_WSL_update.png\" alt=\"\" width=\"500\" height=\"384\"><\/a><\/p>\n<h3>Docker Desktop installation<\/h3>\n<p>Download the latest <a href=\"https:\/\/hub.docker.com\/editions\/community\/docker-ce-desktop-windows\/\">Docker Desktop for Windows<\/a> installer from Docker Hub.<br \/>\nThe installation is pretty straightforward.<\/p>\n<table style=\"border-collapse: collapse;width: 100%\">\n<tbody>\n<tr>\n<td style=\"width: 50%\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44524\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/05_DockerInstall.png\" alt=\"\" width=\"510\" height=\"349\"><\/td>\n<td style=\"width: 50%\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44525\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/06_DockerInstall.png\" alt=\"\" width=\"500\" height=\"342\"><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44526\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/07_DockerInstall.png\" alt=\"\" width=\"500\" height=\"341\"><\/td>\n<td style=\"width: 50%\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44527\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/08_DockerInstall.png\" alt=\"\" width=\"500\" height=\"341\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Now that Docker Desktop is installed you can go into the Docker Settings and verify that the &#8220;Use the WSL 2 based engine&#8221; option is checked.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/13_DockerDesktopSettings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44544\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/13_DockerDesktopSettings.png\" alt=\"\" width=\"400\" height=\"311\"><\/a><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/10_DockerDesktopWslbasedengine-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44546\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/10_DockerDesktopWslbasedengine-3.png\" alt=\"\" width=\"958\" height=\"599\"><\/a><\/p>\n<p>Now that Docker Desktop is installed you can use the following command to list distributions installed on your computer. Docker Desktop comes with 2 distributions and we can verify what version WSL we have.<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/14_CheckWSLVersion.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44553\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/14_CheckWSLVersion.png\" alt=\"\" width=\"671\" height=\"136\"><\/a><\/p>\n<h3>Run an SQL Server container<\/h3>\n<p>We are now all set up.<br \/>\nTo start working with a container we first need to choose a container image to run from.<br \/>\nThe list of official SQL Server from Microsoft <a href=\"https:\/\/hub.docker.com\/_\/microsoft-mssql-server\">is available on Docker Hub<\/a>. I will choose the 2019 CU8 on Ubuntu 16.04 one.<\/p>\n<p>To get the image from the online registry just run the &#8220;docker pull&#8221; command. Docker commands can be used in PowerShell.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/15_DockerPull.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44554\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/15_DockerPull.png\" alt=\"\" width=\"958\" height=\"316\"><\/a><\/p>\n<p>We can list the available images.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/25_DockerImages.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44577\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/25_DockerImages.png\" alt=\"\" width=\"958\" height=\"79\"><\/a><\/p>\n<p>To start a new container from the image the command is &#8220;docker run&#8221;. I specify a name for my container and the SA account&#8217;s password.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/17_DockerRun.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44557\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/17_DockerRun.png\" alt=\"\" width=\"958\" height=\"124\"><\/a><\/p>\n<p>My container is now Up and running. I can check the status with &#8220;docker ps&#8221;.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/18_DockerPS-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44560\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/18_DockerPS-1.png\" alt=\"\" width=\"958\" height=\"105\"><\/a><\/p>\n<h3>Connect to the instance with SSMS<\/h3>\n<p>I mapped the SQL Server default port 1433 to the instance port inside the container (also 1433) so I can just connect with SSMS using &#8220;localhost&#8221; as Server name:<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/19_SSMSconnect.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44561\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/19_SSMSconnect.png\" alt=\"\" width=\"400\" height=\"241\"><\/a><\/p>\n<p>That&#8217;s it. I&#8217;m now connected to my instance.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/20_SSMS_objectExplorer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44562\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/20_SSMS_objectExplorer.png\" alt=\"\" width=\"357\" height=\"334\"><\/a><\/p>\n<p>If I need a new instance again I can run the same command just changing the container name and the port.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/21_Container2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44564\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/21_Container2.png\" alt=\"\" width=\"958\" height=\"87\"><\/a><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/22_Container2_DockerPS-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44568\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/22_Container2_DockerPS-1.png\" alt=\"\" width=\"958\" height=\"133\"><\/a><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/23_SSMS_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44566\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/23_SSMS_2.png\" alt=\"\" width=\"300\" height=\"316\"><\/a><\/p>\n<p>I can confirm the instance is running querying the DMV <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/system-dynamic-management-views\/sys-dm-os-host-info-transact-sql\">sys.dm_os_host_info<\/a>.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/24_SQL_query_linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44569\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/24_SQL_query_linux.png\" alt=\"\" width=\"560\" height=\"175\"><\/a><\/p>\n<h3>Enable the SQL Server Agent<\/h3>\n<p>On the screenshot above we can see the SQL Server Agent is disabled by default. It can be enabled in T-SQL from the instance:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">exec sp_configure 'show advanced options',1\nreconfigure\nexec sp_configure 'Agent XPs',1\nreconfigure<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/26_Agent.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44579\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/26_Agent.png\" alt=\"\" width=\"250\" height=\"286\"><\/a><\/p>\n<p>The SQL Server Agent could be enabled at the run with an <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/linux\/sql-server-linux-configure-environment-variables\">SQL Server environment variable<\/a> ;&nbsp; MSSQL_AGENT_ENABLED. Here is an example;<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/35_AgentEnv.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44597\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/35_AgentEnv.png\" alt=\"\" width=\"815\" height=\"100\"><\/a><\/p>\n<h3>Create a custom image<\/h3>\n<p>Now in T-SQL I will create a database &#8220;TestDB&#8221; with a table and insert rows inside.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">create database testDB\ngo\nuse testDB\ngo\ncreate table testTable (\n\tid int identity primary key\n\t, colA char(4)\n)\ngo\ninsert into testTable(colA) values('test')\ngo 2020<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/28_testDB_select-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44582\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/28_testDB_select-1.png\" alt=\"\" width=\"496\" height=\"240\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>To create an image from my &#8220;sql2019lab&#8221; container I first need to stop it.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/29_container_stop.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44587\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/29_container_stop.png\" alt=\"\" width=\"958\" height=\"175\"><\/a><\/p>\n<p>Then I need to run <a href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/commit\/\">docker commit<\/a>.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/30_newImage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44583\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/30_newImage.png\" alt=\"\" width=\"958\" height=\"152\"><\/a><\/p>\n<p>The image is ready. The image has no repository or tag. I could upload my custom image to Docker Hub and run it from anywhere but I&#8217;ll keep everything locally for now. I can run a container from my new image.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/31_sql2019lab3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44584\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/31_sql2019lab3.png\" alt=\"\" width=\"958\" height=\"304\"><\/a><\/p>\n<p>When I connect to the instance on my new &#8220;sql2019lab3&#8221; container the SQL Server Agent is already running and my database is there.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/32_SSMS_sql2019lab3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44586\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/32_SSMS_sql2019lab3.png\" alt=\"\" width=\"274\" height=\"322\"><\/a><\/p>\n<h3>Transfert a database backup file<\/h3>\n<p>It&#8217;s quite easy to transfer a file from Windows to a running container with the command &#8220;docker cp&#8221;.<br \/>\nHere I copy a database backup into the default directory \/var\/opt\/mssql\/data<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/33_DockerCP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44589\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/33_DockerCP.png\" alt=\"\" width=\"745\" height=\"43\"><\/a><\/p>\n<p>The backup file can be restored from SQL Server in T-SQL or using SSMS.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/34_RestoreDatabase.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44590\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/34_RestoreDatabase.png\" alt=\"\" width=\"639\" height=\"341\"><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>In conclusion, we&#8217;ve seen how easy it is to set up Docker on Windows and run containers.<br \/>\nIt&#8217;s not more complicated than installing SQL Server on a VM with Hyper-V or VirtualBox.<br \/>\nOnce the image has been downloaded a new SQL Server instance can be deployed in a few seconds.<br \/>\nI hope you enjoyed this short introduction to SQL Server in containers.<\/p>\n\n\n<p>Written by <a href=\"https:\/\/www.linkedin.com\/in\/steven-naudet-aa540158\/\">Steven Naudet<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, I will show you the steps I went through to run SQL Server inside a Linux Docker container on my Windows 10 laptop. The aim here is to deploy quickly and easily SQL Server instances in my lab environment. Introduction Since May 2020 Windows ships with WSL 2. Windows System for [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":14977,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,1504,99],"tags":[2163,2550,2165],"type_dbi":[],"class_list":["post-14945","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-administration-monitoring","category-docker","category-sql-server","tag-docker-desktop","tag-sql-server-2","tag-wsl-2"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Getting started with SQL Server on Linux containers with Docker Desktop and WSL2 - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2\" \/>\n<meta property=\"og:description\" content=\"In this blog post, I will show you the steps I went through to run SQL Server inside a Linux Docker container on my Windows 10 laptop. The aim here is to deploy quickly and easily SQL Server instances in my lab environment. Introduction Since May 2020 Windows ships with WSL 2. Windows System for [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-31T15:31:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-01T09:48:21+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png\" \/>\n\t<meta property=\"og:image:width\" content=\"947\" \/>\n\t<meta property=\"og:image:height\" content=\"276\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2\",\"datePublished\":\"2020-10-31T15:31:24+00:00\",\"dateModified\":\"2025-10-01T09:48:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/\"},\"wordCount\":854,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png\",\"keywords\":[\"Docker Desktop\",\"SQL Server\",\"WSL 2\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Docker\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/\",\"name\":\"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2 - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png\",\"datePublished\":\"2020-10-31T15:31:24+00:00\",\"dateModified\":\"2025-10-01T09:48:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png\",\"width\":947,\"height\":276},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2 - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/","og_locale":"en_US","og_type":"article","og_title":"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2","og_description":"In this blog post, I will show you the steps I went through to run SQL Server inside a Linux Docker container on my Windows 10 laptop. The aim here is to deploy quickly and easily SQL Server instances in my lab environment. Introduction Since May 2020 Windows ships with WSL 2. Windows System for [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/","og_site_name":"dbi Blog","article_published_time":"2020-10-31T15:31:24+00:00","article_modified_time":"2025-10-01T09:48:21+00:00","og_image":[{"width":947,"height":276,"url":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png","type":"image\/png"}],"author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2","datePublished":"2020-10-31T15:31:24+00:00","dateModified":"2025-10-01T09:48:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/"},"wordCount":854,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png","keywords":["Docker Desktop","SQL Server","WSL 2"],"articleSection":["Database Administration &amp; Monitoring","Docker","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/","url":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/","name":"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2 - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png","datePublished":"2020-10-31T15:31:24+00:00","dateModified":"2025-10-01T09:48:21+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/01_ComputerVersion.png","width":947,"height":276},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/getting-started-with-sql-server-on-linux-containers-with-docker-desktop-and-wsl2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Getting started with SQL Server on Linux containers with Docker Desktop and WSL2"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=14945"}],"version-history":[{"count":2,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14945\/revisions"}],"predecessor-version":[{"id":40596,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14945\/revisions\/40596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/14977"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=14945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=14945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=14945"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=14945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}