{"id":439,"date":"2025-03-21T18:30:00","date_gmt":"2025-03-21T18:30:00","guid":{"rendered":"https:\/\/imcodinggenius.com\/?p=439"},"modified":"2025-03-21T18:30:00","modified_gmt":"2025-03-21T18:30:00","slug":"run-sql-server-linux-container-images-with-docker","status":"publish","type":"post","link":"https:\/\/imcodinggenius.com\/?p=439","title":{"rendered":"Run SQL Server Linux container images with Docker"},"content":{"rendered":"<p>In this post, you use Docker to pull and run the SQL Server Linux container image and see the demo of connecting from SQL Server Management Studio (SSMS).<br \/>\n<\/p>\n<p>Open your PowerShell with elevated permission and run the following command. It pulls the SQL Server 2022 (16.x) Linux container image from the Microsoft Container Registry.<\/p>\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">docker run -e &#171;ACCEPT_EULA=Y&#187; -e &#171;MSSQL_SA_PASSWORD=&lt;password&gt;&#187; -p 1433:1433 &#8212;name sql1 &#8212;hostname sql1 -d mcr.microsoft.com\/mssql\/server:2022-latest\n<\/div>\n<\/div>\n<p>\n  Fig 1: Docker run &#8212; SQL Server Linux Container<\/p>\n<p>      Parameter<br \/>\n      Description<\/p>\n<p>      -e \u201cACCEPT_EULA=Y\u201d<br \/>\n      confirm your acceptance of the End-User Licensing Agreement.<\/p>\n<p>      -e \u201cMSSQL_SA_PASSWORD=&#187;<br \/>\n      Specify your own strong password.<\/p>\n<p>      -p 1433:1433<br \/>\n      Map a TCP port on the host environment (first value) with a TCP port in the container (second value).<\/p>\n<p>      \u2013name sql1<br \/>\n      Name of the container<\/p>\n<p>      \u2013hostname sql1<br \/>\n      Container hostname<\/p>\n<p>      -d<br \/>\n      Run the container in the background daemon<\/p>\n<p>      mcr.microsoft.com\/mssql\/server:2022-latest<br \/>\n      The SQL Server Linux container image.<\/p>\n<p>Run the following command, \u201cdocker ps\u201d to view your Docker containers.<\/p>\n<p>\n  Fig 2: Docker ps &#8212; View containers<\/p>\n<p>If the STATUS column shows Up, then SQL Server is running in the Docker container and listening on the port.<\/p>\n<p>Docker engine,<\/p>\n<p>\n  Fig 3: Docker Engine<\/p>\n<p>Connect the SQL Server from SSMS,<\/p>\n<p>\n  Fig 4: SSMS &#8212; Connect SQL Server<\/p>\n<p>List all the database,<\/p>\n<p>\n  Fig 5: Database list view<\/p>\n<p>Test database,<\/p>\n<p>\n  Fig 6: Test database<\/p>","protected":false},"excerpt":{"rendered":"<p>In this post, you use Docker to pull and run the SQL Server Linux container image and see the demo of connecting from SQL Server Management Studio (SSMS). Open your PowerShell with elevated permission and run the following command. It pulls the SQL Server 2022 (16.x) Linux container image from &#8230; <\/p>\n<div><a class=\"more-link bs-book_btn\" href=\"https:\/\/imcodinggenius.com\/?p=439\">Read More<\/a><\/div>\n","protected":false},"author":0,"featured_media":440,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=\/wp\/v2\/posts\/439"}],"collection":[{"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=439"}],"version-history":[{"count":0,"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=\/wp\/v2\/media\/440"}],"wp:attachment":[{"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imcodinggenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}