/mssql-server-tmpfs

Primary LanguagePowerShellMIT LicenseMIT

msql-server-tmpfs

Motivation

I recently came across Fast unit tests with databases, part 3 – Implementation of our solution which mentioned how they sped up their integration tests by running the database server in docker with its data directory mounted to an in memory file system.

Unfortunately the docker containers provided by microsoft don't natively allow the data directory to be mounted on tmpfs.

There is a work around here which involves

Masking the O_DIRECT flag of the open function, which the mssql-server uses and which causes the mssql container to not run on tmps

This requires building a new image based of the microsoft provided one with this hack included.

By tagging this repository with a version corresponding to one of the offical Microsoft SQL Server images (for example 2022-latest), a workflow is kicked off that

  1. Builds a new image using that Microsoft SQL Server image but with the hack applied (see dockerfile-template)

  2. Pushes the new image to my docker hub repository with that tag ready for use. For example as image michaelwolfenden/mssql-server-tmpfs:2022-latest

Current images

  • michaelwolfenden/mssql-server-tmpfs:2017-latest
  • michaelwolfenden/mssql-server-tmpfs:2019-latest
  • michaelwolfenden/mssql-server-tmpfs:2022-latest

License

This project is licensed under the MIT License - see the LICENSE.md file for details