Docker - MSSQL 2017

Microsoft has released MSSQL for Linux and they even released a docker container for it. This makes things pretty straight forward to get running.

There are some issues with ZFS datasets because ZFS does not support O_DIRECT. There’s a hack to get it working but it did not for me. It works fine with ext4 though.

  1. Download the container.

    • docker pull mcr.microsoft.com/mssql/server:2017-GA-ubuntu
  2. Configure the systemd server. Change your SA password and the persistent database path (mine is /mnt/db).

    • /etc/systemd/system/mssql.service
    • 1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      Description=MSSQL
      After=docker.service
      Requires=docker.service
      [Service]
      Restart=always
      ExecStartPre=/usr/bin/docker pull mcr.microsoft.com/mssql/server:2017-GA-ubuntu
      ExecStart=/usr/bin/docker run --rm -e ACCEPT_EULA=Y -e SA_PASSWORD=PASSWORD -e MSSQL_PID=Express -p 1433:1433 --name mssql -v /mnt/db:/var/opt/mssql mcr.microsoft.com/mssql/server:2017-GA-ubuntu
      ExecStop=/usr/bin/docker stop mssql
      [Install]
      WantedBy=local.target
  3. Use a Windows PC to access the database using SQL Server Management Studio.