Profile Picture

Docker, LazyNvim

Docker: How to Setup MSSQL

  1. Mac OS has emulation for non-ARM docker images with Rosetta 2
  2. This is particularly useful for MSSQL on MacOS, as I had initially reverted to using Azure SQL Edge (arm supported).
  3. There is a performance hit with Rosetta 2 on Mac, but I think it's not too much.
  4. Top tip, for seeding the DB with actual test data, add the copy within the Dockerfile allowing the user to specify file location manually so the backup or restore file not stored in git.
  5. The easiest restore process is fire up the container, and run a restore from Azure Data Studio or SQL Server Management Studio.
RESTORE DATABASE [YourDatabaseName] FROM DISK = '/var/opt/mssql/backup/file.bak' 
WITH MOVE 'YourDataFile' TO '/var/opt/mssql/data/YourDataFile.mdf', 
     MOVE 'YourLogFile' TO '/var/opt/mssql/data/YourLogFile.ldf';
  1. If you need to determine the name of DataFile and LogFile, use the following:

Jump into your MSSQL container

docker exec -it temp-sql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "yourStrong(!)Password"

Get the DataFile and LogFile name

RESTORE FILELISTONLY FROM DISK = '/var/opt/mssql/backup/file.bak';


Find words or strings quickly

  • Find words quickly in a file: s + + <autogenerated_letter> Eg. s Get j
  • This will search for letters "Get" in the file, and go to the location "j" as generated by LazyNvim (or Leap plugin).

Go back or forward on buffer history

  • [ b : to go back
  • ] f : to go forward

Find your Keymaps

  • sk : shows all keymaps

Pull up Warnings

  • xx: Show warings and errors

LazyNvim LazyNvim Intro Tutorial