Skip to content

Dockerfile/docker-compose for sql-server with helper scripts to mount .mdf databases

Notifications You must be signed in to change notification settings

toledompm/dockerized-sql-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized SQL-Server 2019

Mounts .mdf databases in a dockerized sql-server instance.

Run it

1 - Place .mdf and .ldf files in Data directory.

Important notes:

  • database name will be based on .mdf file name.
  • exepected log filename to follow mdf_file_name_log.ldf

example:

Data
  | - foo_log.ldf
  | - foo.mdf

will generate a database named Foo

Dockerfile

The original article explained very well how to get up and running with a Dockerfile build, if you intend to go with that route I recomend you check them out.

Dockercompose

2 - Build image and bring containers up.

$ docker-compose up

3 - Run the attach script.

Wait for server to be brought up Open another shell and run:

$ make attach

Based on resources from the following article:

Run your SQL Server MDF file inside a linux Docker Container The core of this repository was taken from the article. Changes consists in generalizing attach_db script and wrapping Dockerfile in a compose file.

About

Dockerfile/docker-compose for sql-server with helper scripts to mount .mdf databases

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published