Sign inSign up

sqlchen/mssql-server-windows-developer

By sqlchen

•Updated almost 5 years ago

Microsoft SQL Server 2019 developer edition on Windows 2019 x64

Image
7

2.9K

sqlchen/mssql-server-windows-developer repository overview

⁠mssql-server-windows-developer

This is the repository for the latest version of SQL Server Developer Edition on Windows Container.

⁠Contents

About this container⁠
Run this container⁠

⁠About this container

It's based on

  1. SQL Server 2019 Developer Edition (https://go.microsoft.com/fwlink/?linkid=866662⁠)
  2. Windows Server 2019 (mcr.microsoft.com/windows/servercore:ltsc2019-amd64)

DOCKERFILE⁠

⁠Run this container

You can run the container with the following command.

docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password=<YOUR SA PASSWORD> -e ACCEPT_EULA=Y -e attach_dbs="<DB-JSON-CONFIG>" sqlchen/mssql-server-windows-developer
  • -p HostPort:containerPort is for port-mapping a container network port to a host port.

  • -v HostPath:containerPath is for mounting a folder from the host inside the container.

    This can be used for saving database outside of the container.

  • -it can be used to show the verbose output of the SQL startup script.

    Use this to debug the container in case of issues.

The image provides two environment variables to optionally set:

  • accept_eula: Confirms acceptance of the end user licensing agreement found here⁠

  • sa_password: Sets the sa password and enables the sa login

  • attach_dbs: The configuration for attaching custom DBs (.mdf, .ldf files).

    This should be a JSON string, in the following format (note the use of SINGLE quotes!)

    [
      {
      	'dbName': 'MaxDb',
      	'dbFiles': ['C:\\temp\\maxtest.mdf',
      	'C:\\temp\\maxtest_log.ldf']
      },
      {
      	'dbName': 'PerryDb',
      	'dbFiles': ['C:\\temp\\perrytest.mdf',
      	'C:\\temp\\perrytest_log.ldf']
      }
    ]
    

    This is an array of databases, which can have zero to N databases.

    Each consisting of:

    • dbName: The name of the database

    • dbFiles: An array of one or many absolute paths to the .MDF and .LDF files.

      Note: The path has double backslashes for escaping! The path refers to files within the container. So make sure to include them in the image or mount them via -v!

This example shows all parameters in action:

docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password=<YOUR SA PASSWORD> -e ACCEPT_EULA=Y -e attach_dbs="[{'dbName':'SampleDB','dbFiles':['C:\\temp\\sampledb.mdf','C:\\temp\\sampledb_log.
ldf']}]" microsoft/mssql-server-windows-developer

Tag summary

Content type

Image

Digest

Size

4.4 GB

Last updated

almost 5 years ago

docker pull sqlchen/mssql-server-windows-developer