1

I am having reasonable success running SQL Server for Linux on Docker for Mac, as per the instructions on https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-docker. The article also notes that:

Volume mapping for Docker-machine on Mac with the SQL Server on Linux image is not supported at this time.

This, of course, makes it difficult to do any more than really simple testing on the Mac if you have to re-install the database every time you start up Docker.

Has anybody a suggested strategy for maintaining a database beyond the current session?

3
  • Yeah, for now, you have those limits. I have a project database that I backup and restore in my next session (and I can do that using the Mac disk no problem, as I show in this post. For me, the lighter weight of the container vs. a VM is worth that extra step. I've been having major CPU issues with Parallels lately, but no chance to troubleshoot yet. Feb 15 '17 at 23:32
  • @AaronBertrand I gave up on Parallels some time ago when they started to sneak in a pesudo-subscription pricing model. VirtualBox does for me, though my demands are not heavy.
    – Manngo
    Feb 15 '17 at 23:34
  • Yeah I wasn't happy about that either. But VirtualBox on Mac was completely unstable for me - the second time I lost work I conceded that you get what you pay for, removed it, and will never try again. Feb 16 '17 at 0:15
4

This is a known issue: mapping volumes on Macs isn't supported yet. You can follow that Github issue for more news, like when it's fixed.

Until then, no, people aren't doing anything more than simple testing with that combination of tools (Mac, Docker, Linux, SQL Server).

If you need to do real, productive development on a platform that's supported today, use:

  • The current supported version of SQL Server (2016, as of this writing)
  • Running on a currently supported OS (Windows, as of this writing)
  • If you insist on using a Mac as your hardware layer (as I do too), then the easiest way to bridge these technologies is a hypervisor like VMware Fusion or Parallels
2
  • Thanks. Currently I use VirtualBox but I was hoping for a lighter solution. I don’t use MS SQL seriously, but I’m doing some testing of concepts in it.
    – Manngo
    Feb 15 '17 at 20:38
  • Gotcha. For a lighter solution, if you're only testing concepts, check out the Microsoft Virtual Labs. You can access them remotely for free. They have a lot of gotchas, like time limits and an inability to copy/paste, but they're a much lighter solution.
    – Brent Ozar
    Feb 15 '17 at 20:44
1

@BrentOzar answered my question, but I have since found a workable solution.

An alternative approach is to use a Data Volume Container. Simply put:

docker create -v /var/opt/mssql --name mssql microsoft/mssql-server-linux /bin/true

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=…' -p 1433:1433 --volumes-from mssql -d --name sql-server microsoft/mssql-server-linux

In the above:

  • --name mssql: mssql is an arbitrary name for your data container
  • -e SA_PASSWORD=…: obviously needs to be a real password
  • --name sql-server: sql-server is an arbitray name for my SQL Server container.

It works after successive restarts of Docker.

Thanks also to @AaronBertrand for pointing me to https://github.com/Microsoft/mssql-docker/issues/12 and, from there to @twright-msft for pointing me to Data Volume Containers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.