Saturday, May 21, 2016

Docker Containers in Windows Server 2016 Pre Release

SQL server Express Example:

Installation:

  1. Download Windows server 2016 ISO image and install inside Virtual Box

2. Install-PackageProvider ContainerImage -Force
Once installed, a list of Base OS images can be returned using Find-ContainerImage.
Find-ContainerImage

Name                           Version          Source           Summary
----                           -------          ------           -------
NanoServer                     10.0.14300.1010  ContainerImag... Container OS Image of Windows Server 2016 Technical...
WindowsServerCore              10.0.14300.1000  ContainerImag... Container OS Image of Windows Server 2016 Technical...
3. Download WindowsServerCore and NanoServer Docker Images
Install-ContainerImage -Name NanoServer
Install-ContainerImage -Name WindowsServerCore
4. Download DockerFile for MS SQL Server Express

wget https://github.com/brogersyh/Dockerfiles-for-windows/archive/master.zip -outfile master.zip

5. Unzip Docker file and build docker image from docker file, this operation would take up to 1 hour.

expand-archive master.zip
cd master\dockerfiles-for-windows-master\sqlexpress

docker build -t sqlexpress .
docker images


6. This example demonstrate running 2 SQL Server Express instances together ruing on ports 1433 and 1434, following command with create firewall exception rules
if (!(Get-NetFirewallRule | where {$_.Name -eq "SQLServer 1433"})) { New-NetFirewallRule -Name "SQL Server 1433" -DisplayName "SQL Server 1433" -Protocol tcp -LocalPort 1433 -Action Allow -Enabled True}

if (!(Get-NetFirewallRule | where {$_.Name -eq "SQLServer 1434"})) { New-NetFirewallRule -Name "SQL Server 1434" -DisplayName "SQL Server 1434" -Protocol tcp -LocalPort 1434 -Action Allow -Enabled True} 

7. Run sqlexpress image on host post 1434 named as sql2
mkdir c:\sql
mkdir c:\sql2 



8. Connect SQL server express from network, this example using SQL Work Bench on a MAC






Followers

Search This Blog