Skip to content

jkososki/docker-mssql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker MSSQL

Docker image for running dev instances of SQL Server.

Build

Build the image with the following:

#!/bin/bash
docker build -t mssql .

Configuration

The following environment variables have been set to configure sql server:

Variable Value
MSSQL_DATA_DIR /tmp/mssql
MSSQL_LOG_DIR /tmp/mssql
MSSQL_BACKUP_DIR /tmp/mssql

The following environment variables can be used within this build:

Variable Description
wwi If set a new copy of the Wide World Importers sample database will be downloaded and restored.
scripts A comma delimited list of scripts that will be executed at container instansiation.

Run with Wide World Importers

Set the environment variable wwi to download and install the Wide World Importers sample database.

#!/bin/bash
docker run -d -p 1433:1433 -e wwi=true mssql

Run the container and configure the Wide World Importers sample database. Use a volume for database files.

#!/bin/bash
docker run -d -p 1433:1433 -v $(pwd)/db:/tmp/mssql mssql

Execute sql scripts

This is a good way to attach database files. Place all database files and sql scripts in the container's /tmp/mssql path and run the container.

#!/bin/bash
docker run -d -p 1433:1433 -e scripts="attachdb.sql" -v $(pwd)/db:/tmp/mssql mssql

Note: Scripts are executed after the wwi restore is complete.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published