Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save braxton-bell/5732c8cf405f84f2e4dd6588a527bcfb to your computer and use it in GitHub Desktop.

Select an option

Save braxton-bell/5732c8cf405f84f2e4dd6588a527bcfb to your computer and use it in GitHub Desktop.
This guide provides steps to configure SQL Server Express in Docker

How to Configure SQL Server Express in Docker

See: Docker Express: Running a local SQL Server Express | by Maarten Merken | Agilix | Medium

  1. Start Container:
    docker run -e "ACCEPT_EULA=Y" `
    -e "MSSQL_SA_PASSWORD=MyPass@word" `
    -e "MSSQL_PID=Express" `
    -p 1433:1433 `
    -d --name=sqlexpress.local `
    -v tsql-seal:/var/opt/mssql `
    mcr.microsoft.com/mssql/server:latest

Important: The example from Medium by Maarten uses the following switch to mount the docker volume: -v tsql-seal:/var/opt/mssql.data This does not work with Docker named volumes. Instead use -v tsql-seal:/var/opt/mssql. See > Is it possible to create a volume with 'Microsoft SQL Server' docker container? - Stack Overflow

Optional: Add the container hostname ( sqlexpress-seal.local ) to the hosts file in the local OS environment.

  1. Connect from SQL Server Manager
  Server name: <HOST NAME>
  Authentication: SQL Server Authentication
  Login: sa
  Password: MyPass@word
  1. Install "Northwinds" database

  2. Example connection string:

Server=<HOST NAME>,1433;Integrated Security=false;User Id=sa;Password=MyPass@word;Database=Northwind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment