docker - creating an image that restore database from .bak files.

Microsoft host a mssql docker image that use 'attach' method to mount database - this assume you have .mdf / ldf files available.

To deal with .bak files, it can be tricky. Hence i have created the following docker image and powershell scripts.

The docker file.



This is not possible without "mountdb.ps1".  This scripts generate and runs restore command




This scripts runs "Invoke-SqlCmd" to execute scripts and doesn't really required login.

It then runs, start.ps1 which change sa's password base on your environment settings.


Git repo can be found here.


Comments

Popular posts from this blog

PySpark - Working with JDBC Sqlite database