7. > docker run -e 'ACCEPT_EULA=Y’
-e 'SA_PASSWORD=yourStrong133tPassword'
-p 1433:1433 microsoft/mssql-server-linux
This is an evaluation version. There are [154] days left in the evaluation period.
2017-06-09 22:16:14.27 Server Setup step is copying system data file 'C:templatedatamaster.mdf' to '/var/opt/mssql/data/master.mdf'.
2017-06-09 22:16:14.36 Server Setup step is copying system data file 'C:templatedatamastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'.
2017-06-09 22:16:14.37 Server Setup step is copying system data file 'C:templatedatamodel.mdf' to '/var/opt/mssql/data/model.mdf'.
2017-06-09 22:16:14.40 Server Setup step is copying system data file 'C:templatedatamodellog.ldf' to
'/var/opt/mssql/data/modellog.ldf'.
2017-06-09 22:16:14.42 Server Setup step is copying system data file 'C:templatedatamsdbdata.mdf' to
'/var/opt/mssql/data/msdbdata.mdf'.
2017-06-09 22:16:14.45 Server Setup step is copying system data file 'C:templatedatamsdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'.
2017-06-09 22:16:14.57 Server Microsoft SQL Server 2017 (CTP2.1) - 14.0.600.250 (X64)
May 10 2017 12:21:23
Copyright (C) 2017 Microsoft Corporation. All rights reserved.
Developer Edition (64-bit) on Linux (Ubuntu 16.04.2 LTS)
2017-06-09 22:16:14.58 Server UTC adjustment: 0:00
2017-06-09 22:16:14.58 Server (c) Microsoft Corporation.
2017-06-09 22:16:14.58 Server All rights reserved.
2017-06-09 22:16:14.58 Server Server process ID is 4116.
12. $ cat Dockerfile
FROM microsoft/dotnet:1.1.1-sdk
RUN mkdir /app
WORKDIR /app
COPY dotnetapp.csproj /app/
RUN dotnet restore
COPY . /app
RUN dotnet publish -c Release -o out
EXPOSE 5000/tcp
CMD ["dotnet", "out/dotnetapp.dll"]
13. $ docker build -t katacoda/dotnet-example:v1 .
Sending build context to Docker daemon 137.7 kB
Step 1/11 : FROM microsoft/dotnet:1.1.1-sdk
Step 2/11 : RUN mkdir /build
Step 3/11 : WORKDIR /build
Step 4/11 : COPY dotnetapp.csproj .
Step 5/11 : RUN dotnet restore
Step 6/11 : COPY . .
Step 7/11 : RUN dotnet publish -c Release -o out
---> Running in fcde25425eee
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
dotnetapp -> /build/bin/Release/netcoreapp1.1/dotnetapp.dll
Step 8/11 : FROM microsoft/dotnet:1.1.1-runtime
Step 9/11 : WORKDIR /app
Step 10/11 : CMD dotnet dotnetapp.dll
Step 11/11 : COPY --from=0 /build/out /app/
Successfully built 1dbec44d4150
Successfully tagged katacoda/dotnet-example:v1.1
14. $ docker run -d
-t -p 5000:5000
--name app
katacoda/dotnet-example:v1
$ curl dockerhost:5000
Request processed by zb8gh24wva
15.
16. # First Stage
FROM microsoft/dotnet:1.1.1-sdk
WORKDIR /app
COPY dotnetapp.csproj /app/
RUN dotnet restore
COPY . /app/
RUN dotnet publish -c Release -o out
# Second Stage
FROM microsoft/dotnet:1.1.1-runtime
WORKDIR /app
CMD ["dotnet", "dotnetapp.dll”]
COPY --from=build out /app/
17. Optimised Image
REPOSITORY TAG IMAGE ID
CREATED SIZE
katacoda/dotnet-example v1 d69cf725c406
5 seconds ago 266.3 MB
katacoda/dotnet-example v1 b8f8b523d3ca
6 minutes ago 894.7 MB
21. Windows Hyper-V Containers
Windows Kernel
Windows Server 2016
SQL
Server
MSMQ
IIS /
ASP.NET
Windows Kernel
Windows Utility VM
Hyper-V
Docker Engine
22.
23. Windows Server Core
• Nearly Win32 Compatible
• Same behaviour of Windows
• Install all of the same tooling
24. 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
25. Windows Server Core => Ubuntu Linux
Windows Nano => Alpine Linux
Windows Server Core => Legacy Apps?
Windows Nano => Modern Apps?
35. > type Dockerfile
FROM microsoft/windowsservercore:10.0.14393.693
RUN powershell.exe Install-WindowsFeature web-server
> docker build –t iis .
36.
37.
38. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["powershell", "-command“]
39. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-
WindowsFeature Web-Asp-Net45
40. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["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‘
41. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["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
42. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["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
85. Kubernetes Operators
• An Operator represents human operational knowledge
in software to reliably manage an application.
• https://coreos.com/operators/