none
Do Something Useful with Containers - SQL 2016 TP 2.3 RRS feed

  • Question

  • Has anyone had any luck doing anything useful with Windows 2016 TP 3 Containers? I have done all the demo stuff and worked hashed out the details of getting 2 - 4 containers going with RDP and basic PowerShell and file additions. I would like to fire up a copy of SQL 2016 and do something meaningful. I feel like I'm close after a few dozen attempts, but I'm stuck trying to do simple maintenance (like reboot in windows RDP or through docker start/stop,etc.) and really getting frustrated with NetFX3. I have it saying Enabled, yet SQL won't take it. Has anyone done this yet? I came across a post with a single image showing the executable running, but no instructions or hints.

    Things I have tried:

    • Create Base Docker images based on WindowsServerCore 2016 TP3
    • Disable FW
    • Rebooted lots, sometimes things don't work even though commands show commit was successful (reboot works in my VM)
    • Enable NetFX3
    • Enable RDP
    • Setup NAT, etc. and verify connectivity
    • Running 2016 TP 3 as VM in Parallels Desktop 11 for Mac (pretending it's bare metal)
    • Custom Image with dockerfile to add SQL and Windows bits
    • DISM succesful for most features/roles that are not IIS related
    • Create my SQL install plan

    Here is my setup.exe plan:

    Setup.exe /q /ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SECURITYMODE=SQL /SAPWD="SuperAmazingNeverBeforeUsedandComplexPasswordisPassword" /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSYSADMINACCOUNTS="BUILTIN\Administrators" /IACCEPTSQLSERVERLICENSETERMS

    I'm sure someone has something better or a maybe a new beta or update with this going. It's been a few weeks since it came out right. ;)

    Tuesday, September 8, 2015 1:29 AM

Answers

  • If you're using PowerShell to manage your containers, this guide will explain how to create an image from a container.
    If you're using Docker, this one will explain how to do that.

    Thursday, September 17, 2015 12:10 AM
    Moderator
  • I think this will get you there. Then you can move the image around and run multiples on the same machine. 

    DOCKER COMMIT [containerID]


    Thursday, September 17, 2015 5:43 PM

All replies

  • I am currently documenting Windows Server Containers at http://kristiannese.blogspot.com and have so far written two parts. On my list, I also have a blog post that will show how to use containers in a "useful" context, and I was planning to show SQL. I am almost there and will share my findings as soon as I have completed the scenario.

    -kn


    Kristian (Virtualization and some coffee: http://kristiannese.blogspot.com )

    Wednesday, September 9, 2015 5:40 PM
  • OK, I believe I have finally been able to get a prototype of this going. I have installed SQL Server 2016 CTP 2.3 using the command line above. I created a DB on my local instance and in the container. The trick with getting around the installation was to convince the container that it had .NET v3.5 with SP1. This was done by importing the registry keys from my base image. I took the container base image (provided by MS), mounted it with dism, loaded the feature, committed the changes, exported the registry keys in "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" and everything below. I added the bits to my images using the NGINX tutorial and then imported the keys and ran setup. I appear to be connect to the container host by using SQL Server Management studio. I created a DB on my local host and it's not on the container instance and vice, versa.

    Does anyone know how to make an image of what I have now so I can play with a container image that has SQL already installed? Is that possible in this build?

    Tuesday, September 15, 2015 3:49 AM
  • If you're using PowerShell to manage your containers, this guide will explain how to create an image from a container.
    If you're using Docker, this one will explain how to do that.

    Thursday, September 17, 2015 12:10 AM
    Moderator
  • I think this will get you there. Then you can move the image around and run multiples on the same machine. 

    DOCKER COMMIT [containerID]


    Thursday, September 17, 2015 5:43 PM
  • Thank you Ender and Scott - this worked and I have 3 containers going now with SQL 2016 on Windows 2016 and can spin up new containers with a single command and I have a setup script inside the image that allows for a bit of tuning, etc. The original instance that I used to setup is working wonderfully as a container while the others have some issues like failing to start or issues with services not running a boot up, but I'll call this a success and proof that SQL 2016 will run on Windows Server 2016 Containers.
    Friday, September 18, 2015 12:46 AM
  • Hi Scott,

    Docker build does not support the port forwarding parameter. The first step is to create a new container image with docker build and then create a new container with the ports forwarded using docker run. (e.g. docker run --rm -it -p 50001:1433 [imagename] powershell)

    Hope this helps,

    Lars


    This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use

    Friday, September 18, 2015 4:51 PM