deploying applications to windows server 2016 and windows containers
TRANSCRIPT
![Page 1: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/1.jpg)
Deploying Applications to Windows Containers and Windows Server 2016
OcelotUproar.com / Katacoda.com
![Page 2: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/2.jpg)
![Page 3: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/3.jpg)
![Page 4: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/4.jpg)
Deploying Applications to Windows Containers and Windows Server 2016
OcelotUproar.com / Katacoda.com
![Page 5: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/5.jpg)
@Ben_Hall / Blog.BenHall.me.uk
Docker London OrganiserMicrosoft MVP in Cloud / Datacentre Management
Software Development Studio
WH
O AM
I?
![Page 6: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/6.jpg)
Learn via Interactive Browser-Based LabsKatacoda.com
![Page 7: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/7.jpg)
Agenda• Windows Server 2016• Building and deploying Windows Containers• Differences to Linux• Hyper-V Containers• Docker API / Kubernetes / Swarm• Future
![Page 8: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/8.jpg)
![Page 9: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/9.jpg)
http://www.infoworld.com/article/3072929/linux/containers-101-linux-containers-and-docker-explained.html
![Page 10: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/10.jpg)
Containers are not Virtual Machines
Think of Docker more as a process management
![Page 11: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/11.jpg)
Docker - An open platform for distributed applications for developers and sysadmins.
![Page 12: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/12.jpg)
Batteries included but removable
![Page 13: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/13.jpg)
Three Key Concepts• Docker Containers – Running Processes
• Docker Images – “Layered Zip Files”
• Docker Registry – Where Images are stored
![Page 14: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/14.jpg)
![Page 15: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/15.jpg)
![Page 16: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/16.jpg)
http://windows-wallpapers.net/wp-content/uploads/images/1c/windows-98.png
2016
![Page 17: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/17.jpg)
Windows Server Core
Windows Nano
Windows Containers
Windows Hyper-V
Containers
![Page 18: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/18.jpg)
Windows Containers
Windows KernelWindows Server 2016
SQL Server MSMQ IIS /
ASP.NET Docker Engine
![Page 19: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/19.jpg)
Windows Hyper-V Containers
Windows Kernel
Windows Server 2016
SQL Server MSMQ IIS /
ASP.NET
Windows Kernel
Windows Utility VM
Hyper-V
Docker Engine
![Page 20: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/20.jpg)
![Page 21: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/21.jpg)
Windows Server Core• Nearly Win32 Compatible• Same behaviour of Windows• Install all of the same tooling
![Page 22: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/22.jpg)
Windows Nano• Stripped down• Smallest footprint• 1/20th the size of Windows Server Core• Only essential components– Hyper-V, Clustering, Networking, Storage, .Net,
Core CLR
![Page 23: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/23.jpg)
Windows Server Core => Ubuntu Linux
Windows Nano => Alpine Linux
Windows Server Core => Legacy Apps?
Windows Nano => Modern Apps?
![Page 24: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/24.jpg)
Installing Windows Containers
![Page 25: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/25.jpg)
> Install-Module -Name DockerMsftProvider \ -Repository PSGallery -Force> Install-Package -Name docker \ -ProviderName DockerMsftProvider> Restart-Computer -Force
![Page 26: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/26.jpg)
![Page 27: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/27.jpg)
![Page 28: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/28.jpg)
Layered Zip File
![Page 29: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/29.jpg)
Windows Linux Subsystem• Completely unrelated• Maybe not in the future…
![Page 30: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/30.jpg)
What is a Windows Docker Image?
![Page 31: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/31.jpg)
PS C:\> docker imagesREPOSITORY TAG IMAGE ID CREATEDwindowsservercore 10.0.10586.0 6801d964fda5 2 weeks ago windowsservercore latest 6801d964fda5 2 weeks ago nanoserver 10.0.10586.0 8572198a60f1 2 weeks ago nanoserver latest 8572198a60f1 2 weeks ago
![Page 32: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/32.jpg)
PS C:\> docker run -it \ windowsservercore cmd
Thank you to https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/manage_docker
![Page 33: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/33.jpg)
SSMS
![Page 34: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/34.jpg)
Building Windows based Docker Images
![Page 35: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/35.jpg)
![Page 36: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/36.jpg)
![Page 37: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/37.jpg)
![Page 38: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/38.jpg)
![Page 39: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/39.jpg)
![Page 40: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/40.jpg)
![Page 41: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/41.jpg)
Latest Tag• Official images have a convention of :latest
• Using :latest can introduces problems
• Use CI build number / Semver
![Page 42: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/42.jpg)
![Page 43: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/43.jpg)
![Page 44: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/44.jpg)
Dockerfile
![Page 45: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/45.jpg)
> type DockerfileFROM microsoft/windowsservercore:10.0.14393.693RUN powershell.exe Install-WindowsFeature web-server
> docker build –t iis .
![Page 46: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/46.jpg)
![Page 47: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/47.jpg)
![Page 48: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/48.jpg)
> type DockerfileFROM microsoft/iis:windowsservercore-10.0.14393.693SHELL ["powershell", "-command“]
![Page 49: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/49.jpg)
> type DockerfileFROM microsoft/iis:windowsservercore-10.0.14393.693SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-WindowsFeature Web-Asp-Net45
![Page 50: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/50.jpg)
> type DockerfileFROM microsoft/iis:windowsservercore-10.0.14393.693SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-WindowsFeature Web-Asp-Net45
RUN Remove-Website -Name 'Default Web Site'; \ mkdir c:\NerdDinner; \ New-Website -Name 'nerd-dinner' \ -Port 80 -PhysicalPath 'c:\NerdDinner' \ -ApplicationPool '.NET v4.5‘
![Page 51: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/51.jpg)
> type DockerfileFROM microsoft/iis:windowsservercore-10.0.14393.693SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-WindowsFeature Web-Asp-Net45
RUN Remove-Website -Name 'Default Web Site'; \ mkdir c:\NerdDinner; \ New-Website -Name 'nerd-dinner' \ -Port 80 -PhysicalPath 'c:\NerdDinner' \ -ApplicationPool '.NET v4.5‘
EXPOSE 80
![Page 52: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/52.jpg)
> type DockerfileFROM microsoft/iis:windowsservercore-10.0.14393.693SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-WindowsFeature Web-Asp-Net45
RUN Remove-Website -Name 'Default Web Site'; \ mkdir c:\NerdDinner; \ New-Website -Name 'nerd-dinner' \ -Port 80 -PhysicalPath 'c:\NerdDinner' \ -ApplicationPool '.NET v4.5‘
EXPOSE 80
COPY NerdDinner c:\NerdDinner
![Page 53: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/53.jpg)
PS C:\> docker build –t nerddinner .
![Page 54: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/54.jpg)
PS C:\> docker run -d -p 80:80 \ nerddinner
![Page 55: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/55.jpg)
PS C:\> docker build –t nerddinner .
![Page 56: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/56.jpg)
PS C:\> docker run -d -p 80:80 \ nerddinner
![Page 57: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/57.jpg)
PS C:\> docker run -d -p 80:80 \ nerddinner
![Page 58: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/58.jpg)
PS C:\> docker run -d -p 80:80 \ --isolation=hyperv nerddinner
![Page 59: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/59.jpg)
ImmutableDisposable Container Pattern
![Page 60: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/60.jpg)
Windows Updates?
![Page 61: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/61.jpg)
![Page 62: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/62.jpg)
Persisting Data – Data Volumes
> docker run –v <host-dir>:<container-dir> image
-v C:\source:C:\dest
-v C:\container-share\config.ini
-v d:
-v C:\nerddinner\logs:C:\inetpub\logs\LogFiles
![Page 63: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/63.jpg)
Limit CPU Shares> docker run -it --cpu-shares 2 \ --name dockerdemo \ windowsservercore cmd
![Page 64: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/64.jpg)
Powershell APIPS C:\> Get-ContainerImageName Publisher Version IsOSImage---- --------- ------- ---------NanoServer CN=Microsoft 10.0.10584.1000 TrueWindowsServerCore CN=Microsoft 10.0.10584.1000 True
![Page 65: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/65.jpg)
PS C:\> New-Container -ContainerImageName WindowsServerCore -Name demo -ContainerComputerName demo
Name State Uptime ParentImageName---- ----- ------ ---------------demo Off 00:00:00 WindowsServerCore
![Page 66: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/66.jpg)
SQL Server Dependency
![Page 67: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/67.jpg)
![Page 68: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/68.jpg)
docker run --name nerddinnerdb -d -p 1433:1433 -e sa_password=password -e ACCEPT_EULA=Y microsoft/mssql-server-windows-express
![Page 69: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/69.jpg)
PS C:\>docker logs nerddinnerdb
![Page 70: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/70.jpg)
docker run --name nerddinnerdb -d -p 1433:1433 -e sa_password=p@sSw0rd1sl0ngY0 -e ACCEPT_EULA=Y microsoft/mssql-server-windows-express
![Page 71: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/71.jpg)
Docker Compose
![Page 72: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/72.jpg)
> cinst –y docker-compose
![Page 73: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/73.jpg)
> type docker-compose.yml
version: '2.1'networks: default: external: name: natservices: nerddinnerdb: image: microsoft/mssql-server-windows-express:2016-sp1-windowsservercore-10.0.14393.447 ports: - "1433:1433" environment: sa_password: "p@sSw0rd1sl0ngY0" ACCEPT_EULA: "Y"
nerddinnerweb: build: . ports: - "80:80" depends_on: - nerddinnerdb
> docker-compose up -d
![Page 74: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/74.jpg)
![Page 75: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/75.jpg)
![Page 76: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/76.jpg)
![Page 77: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/77.jpg)
![Page 78: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/78.jpg)
> type Dockerfile.windowsFROM microsoft/dotnet:1.0.0-preview2.1-nanoserver-sdk
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN New-Item -Path \MusicStore\samples\MusicStore.Standalone -Type DirectoryWORKDIR MusicStore
ADD samples/MusicStore.Standalone/project.json samples/MusicStore.Standalone/project.jsonADD NuGet.config .RUN dotnet restore --no-cache .\samples\MusicStore.Standalone
ADD samples samplesRUN dotnet build .\samples\MusicStore.Standalone
EXPOSE 5000ENV ASPNETCORE_URLS http://0.0.0.0:5000CMD dotnet run -p .\samples\MusicStore.Standalone
https://github.com/taylorb-microsoft/MusicStore
![Page 79: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/79.jpg)
> type docker-compose.ymlversion: '2'services: db: image: microsoft/mssql-server-2016-express-windows environment: sa_password: "Password1" ports: - "1433:1433" # for debug. Remove this for production
web: build: context: . dockerfile: Dockerfile.windows environment: - "Data:DefaultConnection:ConnectionString=Server=db,1433;Database=MusicStore;User Id=sa;Password=Password1;MultipleActiveResultSets=True" depends_on: - "db" ports: - "5000:5000"
networks: default: external: name: nat
> docker-compose up –d --build
https://github.com/taylorb-microsoft/MusicStore
![Page 80: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/80.jpg)
![Page 81: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/81.jpg)
> docker tag nerddinner benhall/nerddinner:v2.0> docker push benhall/nerddinner:v2.0
![Page 82: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/82.jpg)
CI/CD PipelineGit Push Gitlab Starts
Build docker build
Gitlab Start Releasedocker push
Docker Compose Pull/Up
docker pull
![Page 83: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/83.jpg)
> cat .gitlab-ci.yml variables: IMAGE_NAME: registry.katacoda.com:4567/root/front-end TAG: $CI_BUILD_IDstages: - build - pushbuild_production: stage: build script: - docker build -t $IMAGE_NAME:$TAG . only: - masterpush_production: stage: build script: - docker push $IMAGE_NAME:$TAG only: - master
![Page 84: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/84.jpg)
How is this different to Linux?
![Page 85: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/85.jpg)
Kernel Virtualisation
![Page 86: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/86.jpg)
http://www.slideshare.net/Docker/windows-server-and-docker-the-internals-behind-bringing-docker-and-containers-to-windows-by-taylor-brown-and-john-starks
![Page 87: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/87.jpg)
http://www.slideshare.net/Docker/windows-server-and-docker-the-internals-behind-bringing-docker-and-containers-to-windows-by-taylor-brown-and-john-starks
![Page 88: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/88.jpg)
Windows Hyper-V Isolation
![Page 89: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/89.jpg)
Windows Hyper-V Isolation• Problem: Shared Kernel• Solution: Super lightweight virtual machines
• Intel Clear Containers• Ubuntu LXD• IBM are working on something
![Page 90: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/90.jpg)
PS C:\> docker run -it -p 80:80 \ --isolation=hyperv app cmd
1) Windows starts 'Utility VM‘ and freezes state2) Forks VM state, brings up a fresh second VM3) Launches container on VM
![Page 91: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/91.jpg)
Properties of Windows Utility VM• Invisible to Docker and containers• All writes are degraded• Separate Kernel to host• SMB file share to access host data
• In the future used for Linux containers?
![Page 92: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/92.jpg)
What about developers?
![Page 93: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/93.jpg)
![Page 94: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/94.jpg)
Install Containers Support on Windows 10> Enable-WindowsOptionalFeature -Online -FeatureName containers -All> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All> Restart-Computer -Force
> Invoke-WebRequest "https://test.docker.com/builds/Windows/x86_64/docker-1.13.0.zip" -OutFile "$env:TEMP\docker-1.13.0-rc4.zip" -UseBasicParsing> Expand-Archive -Path "$env:TEMP\docker-1.13.0.zip" -DestinationPath $env:ProgramFiles> dockerd --register-service> Start-Service Docker
![Page 95: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/95.jpg)
Docker for Windows
https://www.richard-banks.org/2016/09/docker-for-windows-beta-26.html
![Page 96: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/96.jpg)
Docker for Windows
https://www.richard-banks.org/2016/09/docker-for-windows-beta-26.html
![Page 97: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/97.jpg)
Docker for Windows
https://www.richard-banks.org/2016/09/docker-for-windows-beta-26.html
![Page 98: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/98.jpg)
Running Containers in Production
![Page 99: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/99.jpg)
Swarm
![Page 100: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/100.jpg)
![Page 101: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/101.jpg)
Constraint Scheduler$ docker run \ -e constraint:ostypelabel==windowscompat \ windowservercore cmd
$ docker run \ -e constraint:ostypelabel==linuxcompat \ ubuntu bash
![Page 102: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/102.jpg)
![Page 103: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/103.jpg)
Microsoft, Apprenda, Red Hathttps://github.com/kubernetes/kubernetes/issues/22623
![Page 104: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/104.jpg)
Mesosphere DC/OS
Powering Azure Container Service
![Page 105: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/105.jpg)
Host Fingerprinting• Constraints based deployment
• Container is based on Nano Server, within cluster, deploy to server capable of running Nano Server (ie. Windows Server 2016)Host Fingerprinting
![Page 106: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/106.jpg)
![Page 107: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/107.jpg)
Azure Container Service
![Page 108: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/108.jpg)
![Page 109: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/109.jpg)
The Future?
![Page 110: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/110.jpg)
![Page 111: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/111.jpg)
SQL Server as a Container
![Page 112: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/112.jpg)
Visual Studio as a Container?
![Page 113: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/113.jpg)
Everything as a Container
![Page 114: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/114.jpg)
Deploy Anywhere
![Page 115: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/115.jpg)
www.katacoda.com
![Page 116: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/116.jpg)
![Page 117: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/117.jpg)
![Page 118: Deploying applications to Windows Server 2016 and Windows Containers](https://reader036.vdocuments.us/reader036/viewer/2022062523/5899dd141a28ab4a0b8b6f6d/html5/thumbnails/118.jpg)
Next Steps• Katacoda
• Windows Server 2016 on Azure
• Windows 10