%3CLINGO-SUB%20id%3D%22lingo-sub-1502551%22%20slang%3D%22en-US%22%3EService%20Fabric%20Nodes%20patching%20and%20Container%20patching%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1502551%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20general%2C%20the%20recommendation%20is%20to%20use%20Automatic%20OS%20upgrade%20feature%20of%20Virtual%20Machine%20scale%20set%20as%20patching%20solution%20for%20Service%20Fabric%20in%20production%20refer%20to%20(it%20needs%20durability%20of%20Silver%20and%20above%20for%20nodetype)%20%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Fvirtual-machine-scale-sets-automatic-upgrade%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Fvirtual-machine-scale-sets-automatic-upgrade%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fservice-fabric%2Fservice-fabric-common-questions%23do-service-fabric-nodes-automatically-receive-os-updates%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fservice-fabric%2Fservice-fabric-common-questions%23do-service-fabric-nodes-automatically-receive-os-updates%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%20in%20this%20approach%20updates%20can%20happen%20anytime%20(but%20will%20be%20rolling%20upgrade)%20i.e.%20when%20new%20images%20are%20published.%26nbsp%3B%20If%20you%20don't%20want%20this%20and%20need%20more%20control%20like%20schedule%20patching%20during%20non-peak%20time%20you%20can%20consider%20Patch%20Orchestration%20Application%20refer%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fservice-fabric%2Fservice-fabric-patch-orchestration-application%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fservice-fabric%2Fservice-fabric-patch-orchestration-application%3C%2FA%3E.%20Otherwise%20if%20you%20need%20total%20control%20like%20want%20to%20test%20updates%20in%20lower%20environments%20and%20then%20only%20patch%20prod%2C%20then%20you%20have%20to%20manually%20upgrade%20images%20refer%20%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Fvirtual-machine-scale-sets-automatic-upgrade%23manually-trigger-os-image-upgrades%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Fvirtual-machine-scale-sets-automatic-upgrade%23manually-trigger-os-image-upgrades%3C%2FA%3E%26nbsp%3Bor%20%3CA%20title%3D%22simple%20disable%20node%20with%20intent%20restart%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fservicefabric%2Fdisable-servicefabricnode%3Fview%3Dazureservicefabricps%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Esimply%20disable%20nodes%20one%20by%20one%20with%20intent%20restart%3C%2FA%3E%26nbsp%3Band%20then%20update%20Windows%20and%20then%20%3CA%20title%3D%22enable%20node%20again%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fservicefabric%2Fenable-servicefabricnode%3Fview%3Dazureservicefabricps%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eenable%20node%20again%3C%2FA%3E.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EImportant%20Notes%3A%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EIdeally%2C%20when%20%E2%80%9C%3CA%20title%3D%22enableAutomaticUpdates%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fapi%2Fmicrosoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates%3Fview%3Dazure-dotnet%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EenableAutomaticUpdates%3C%2FA%3E%E2%80%9D%20is%20set%20to%20True%2C%20you%20are%20enabling%20windows%20updates%20i.e.%20patch%20upgrades%2C%20etc.%20(not%20the%20upgrade%20from%202012%20to%202016).%20By%20default%20its%20True.%20These%20updates%20doesn't%20happen%20in%20rolling%20fashion.%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EFor%20scale%20sets%20using%20Windows%20virtual%20machines%20using%20automatic%20OS%20upgrade%20feature%20i.e%26nbsp%3B%3C%2FSPAN%3E%3CA%20title%3D%22enableAutomaticOSUpgrade%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Ftemplates%2Fmicrosoft.compute%2F2018-10-01%2Fvirtualmachinescalesets%23automaticosupgradepolicy-object%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EenableAutomaticOSUpgrade%3C%2FA%3E%26nbsp%3Bset%20to%20True%3CSPAN%3E%2C%20starting%20with%20Compute%20API%20version%202019-03-01%2C%20the%20property%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EvirtualMachineProfile.osProfile.windowsConfiguration.%3CSTRONG%3EenableAutomaticUpdates%3C%2FSTRONG%3E%3C%2FEM%3E%3CSPAN%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3Eproperty%20%3CSTRONG%3Emust%20set%20to%26nbsp%3B%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E%3CEM%3Efalse%3C%2FEM%3E%3C%2FSTRONG%3E%3CSPAN%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3Ein%20the%20scale%20set%20model%20definition.%20The%20above%20property%20enables%20in-VM%20upgrades%20where%20%22Windows%20Update%22%20applies%20operating%20system%20patches%20without%20replacing%20the%20OS%20disk.%20With%20automatic%20OS%20image%20upgrades%20enabled%20on%20your%20scale%20set%2C%20an%20additional%20update%20through%20%22Windows%20Update%22%20is%20not%20required.%20So%20if%20your%20using%20any%20patching%20solution%20in%20prod%2C%20Automatic%20OS%20Upgrade%20feature%20%2F%20Patch%20Orchestration%20Application%20%2F%20Manual%20OS%20upgrades%2C%20ideally%20you%20should%20be%20set%20enableAutomaticUpdates%20to%20false.%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EIf%20you%20are%20patching%20VMSS%20nodes%20you%20should%20also%20make%20sure%20the%20windows%20container%20which%20is%20running%20in%20VMSS%20nodes%20is%20patched%20and%20the%20windows%20version%20should%20be%20matched%20with%20VMSS%20node%20and%20the%20container.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20windows%20containers%2C%20its%20recommended%20that%20both%20should%20be%20patched%20to%20latest%20however%20host%20images%20using%201809%20and%20above%20does%20not%20need%20to%20have%20matching%20revisions%20or%20if%20you%20are%20using%20Hyper-V%20isolation%20mode.%26nbsp%3B%20Refer%20to%20examples.%20%26nbsp%3BYou%20can%20also%20refer%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fvirtualization%252Fwindowscontainers%252Fdeploy-containers%252Fupdate-containers%2523how-to-get-windows-server-container-updates%26amp%3Bdata%3D02%257C01%257Ckhanna.mohit%2540microsoft.com%257C7a8d525812df46d7566d08d81384d2ab%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637280808508733999%26amp%3Bsdata%3Dzmx639eR1g9VMLGOe%252Bn1u6hZQegSz8Tj0BwwU%252FgnTQc%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fvirtualization%2Fwindowscontainers%2Fdeploy-containers%2Fupdate-containers%23how-to-get-windows-server-container-updates%3C%2FA%3E%26nbsp%3Bfor%20getting%20Container%20updates.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWindows%20Server%20containers%20currently%20don't%20support%20scenarios%20where%20Windows%20Server%202016-based%20containers%20run%20in%20a%20system%20where%20the%20revision%20numbers%20of%20the%20container%20host%20and%20the%20container%20image%20are%20different.%20For%20example%2C%20if%20the%20container%20host%20is%20version%2010.0.14393.%3CSTRONG%3E1914%3C%2FSTRONG%3E%26nbsp%3B(Windows%20Server%202016%20with%20KB4051033%20applied)%20and%20the%20container%20image%20is%20version%2010.0.14393.%3CSTRONG%3E1944%3C%2FSTRONG%3E%26nbsp%3B(Windows%20Server%202016%20with%20KB4053579%20applied)%2C%20then%20the%20image%20might%20not%20start.%3C%2FP%3E%0A%3CP%3EHowever%2C%20for%20hosts%20or%20images%20using%20Windows%20Server%20version%201809%20and%20later%2C%20this%20rule%20doesn't%20apply%2C%20and%20the%20host%20and%20container%20image%20don't%20need%20to%20have%20matching%20revisions.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWe%20recommend%20you%20keep%20your%20systems%20(host%20and%20container)%20up-to-date%20with%20the%20latest%20patches%20and%20updates%20to%20stay%20secure.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%201%3C%2FSTRONG%3E%3A%20The%20container%20host%20is%20running%20Windows%20Server%202016%20with%20KB4041691%20applied.%20Any%20Windows%20Server%20container%20deployed%20to%20this%20host%20must%20be%20based%20on%20the%20version%2010.0.14393.1770%20container%20base%20images.%20If%20you%20apply%20KB4053579%20to%20the%20host%20container%2C%20you%20must%20also%20update%20the%20images%20to%20make%20sure%20the%20host%20container%20supports%20them.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%202%3C%2FSTRONG%3E%3A%20The%20container%20host%20is%20running%20Windows%20Server%20version%201809%20with%20KB4534273%20applied.%20Any%20Windows%20Server%20container%20deployed%20to%20this%20host%20must%20be%20based%20on%20a%20Windows%20Server%20version%201809%20(10.0.17763)%20container%20base%20image%2C%20but%20doesn't%20need%20to%20match%20the%20host%20KB.%20If%20KB4534273%20is%20applied%20to%20the%20host%2C%20the%20container%20images%20will%20still%20be%20supported%2C%20but%20we%20recommend%20you%20update%20them%20to%20address%20any%20potential%20security%20issues.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EContainer%20Patching%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20simple%20term%20in%20your%20case%20you%20have%20to%20update%20your%20docker%20file%2C%20working%20with%20containers%20is%20not%20the%20same%20as%20working%20with%20real%20servers%20or%20VM's%20you%20support%20for%20months%20or%20years.%20A%20container%20image%20is%20a%20static%20snapshot%20of%20the%20filesystem%20(and%20Windows%20registry%20and%20so%20on)%20at%20a%20given%20time.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EContainer%20images%20have%20layers%3C%2FP%3E%0A%3CP%3EFirst%20have%20a%20look%20how%20a%20container%20image%20looks%20like.%20It%20is%20not%20just%20a%20snapshot.%20A%20container%20image%20consist%20of%20multiple%20layers.%20When%20you%20look%20at%20your%20Dockerfile%20you%20normally%20use%20a%20line%20like%20FROM%20microsoft%2Fwindowsservercore.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYour%20container%20image%20then%20uses%20the%20Windows%20base%20image%20that%20contains%20a%20layer%20with%20all%20the%20files%20needed%20to%20run%20Windows%20containers.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20some%20higher%20level%20application%20you%20may%20use%20other%20prebuilt%20container%20images%20like%20FROM%20microsoft%2Fiis%20or%20FROM%20microsoft%2Faspnet.%20These%20images%20also%20re-use%20the%20FROM%20microsoft%2Fwindowsservercore%20as%20base%20image.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image1.png%22%20style%3D%22width%3A%20840px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F210218iF66CFF3B3D528B2B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image1.png%22%20alt%3D%22image1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20top%20of%20that%20you%20build%20your%20own%20application%20image%20with%20your%20code%20and%20content%20needed%20to%20run%20the%20application%20in%20a%20self%20contained%20Windows%20container.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBehind%20the%20scenes%20your%20application%20image%20now%20uses%20several%20layers%20that%20will%20be%20downloaded%20from%20the%20Docker%20Hub%20or%20any%20other%20container%20registry.%20Same%20layers%20can%20be%20re-used%20for%20different%20other%20images.%20If%20you%20build%20multiple%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttp%253A%252F%252Fasp.net%252F%26amp%3Bdata%3D02%257C01%257Ckhanna.mohit%2540microsoft.com%257Caf16da9f038d4d23690308d81774284a%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637285134983382235%26amp%3Bsdata%3DVFwhMp6Y%252FPZSJP7%252FrFjm1%252Bq%252BtmvpfDHowDMlNfdGXOo%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EASP.NET%3C%2FA%3E%20applications%20as%20Docker%20images%20they%20will%20re-use%20the%20same%20layers%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20now%20back%20to%20our%20first%20question%3A%20How%20to%20apply%20Windows%20Updates%20in%20a%20container%20image%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Windows%20base%20images%3C%2FP%3E%0A%3CP%3ELet's%20have%20a%20closer%20look%20at%20the%20Windows%20base%20images.%20Microsoft%20provides%20two%20base%20images%3A%20windowsservercore%20and%20nanoserver.%20Both%20base%20images%20are%20updated%20on%20a%20regular%20basis%20to%20roll%20out%20all%20security%20fixes%20and%20bug%20fixes.%20You%20might%20know%20that%20the%20base%20image%20for%20windowsservercore%20is%20about%204%20to%205%20GByte%20to%20download.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20do%20we%20have%20to%20download%20the%20whole%20base%20image%20each%20time%20for%20each%20update%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20we%20look%20closer%20how%20the%20base%20images%20are%20built%20we%20see%20that%20they%20contain%20two%20layers%3A%20One%20big%20base%20layer%20that%20will%20be%20used%20for%20a%20longer%20period%20of%20time.%20And%20there%20is%20a%20smaller%20update%20layer%20that%20contains%20only%20the%20patched%20and%20updated%20files%20for%20the%20new%20release.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image2.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F210219i9084BEF662ADF666%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image2.gif%22%20alt%3D%22image2.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20updating%20to%20a%20newer%20Windows%20base%20image%20version%20isn't%20painful%20as%20only%20the%20update%20layer%20must%20be%20pulled%20from%20the%20Docker%20Hub.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20in%20the%20long%20term%20it%20does%20not%20make%20sense%20to%20stick%20forever%20to%20the%20old%20base%20layer.%20Security%20scanners%20will%20mark%20them%20as%20vulnerable%20and%20also%20all%20the%20images%20that%20are%20built%20from%20them.%20And%20the%20update%20layer%20will%20increase%20in%20size%20for%20each%20new%20release.%20So%20from%20time%20to%20time%20there%20is%20a%20%22breaking%22%20change%20that%20replaces%20the%20base%20layer%20and%20a%20new%20base%20layer%20will%20be%20used%20for%20upcoming%20releases.%20We%20have%20seen%20that%20with%20the%20latest%20release%20in%20December.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image3.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F210220i7871F56AF963335E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image3.gif%22%20alt%3D%22image3.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditormohitkhanna_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFrom%20time%20to%20time%20you%20will%20have%20to%20download%20the%20big%20new%20base%20layer%20which%20is%20about%204%20GByte%20for%20windowsservercore%20(and%20only%20about%20240%20MByte%20for%20nanoserver%2C%20so%20try%20to%20use%20nanoserver%20whereever%20you%20can)%20when%20you%20want%20to%20use%20the%20latest%20Windows%20image%20release.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EKeep%20or%20Update%20%3F%26nbsp%3B%26nbsp%3BShould%20I%20avoid%20updating%20the%20Windows%20image%20to%20revision%20576%20to%20keep%20my%20downloads%20small%3F%20No!%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERecommendation%20is%20to%20update%20all%20your%20Windows%20container%20images%20and%20rebuild%20them%20with%20the%20newest%20Windows%20image.%20You%20have%20to%20download%20that%20bigger%20base%20layer%20also%20only%20once%20and%20all%20your%20container%20images%20will%20re-use%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPerhaps%20your%20application%20code%20also%20has%20some%20updates%20you%20want%20to%20ship.%20It's%20a%20good%20time%20to%20ship%20it%20on%20top%20of%20the%20newest%20Windows%20base%20image.%20So%20is%20recommended%20to%20run%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Edocker%20pull%20microsoft%2Fwindowsservercore%3C%2FP%3E%0A%3CP%3Edocker%20pull%20microsoft%2Fnanoserver%3C%2FP%3E%0A%3CP%3Ebefore%20you%20build%20new%20Windows%20container%20images%20to%20have%20the%20latest%20OS%20base%20image%20with%20all%20security%20fixes%20and%20bug%20fixes%20in%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20keep%20track%20which%20version%20of%20the%20Windows%20image%20you%20use%2C%20you%20can%20use%20the%20tags%20provided%20for%20each%20release.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EInstead%20of%20using%20only%20the%20latest%20version%20in%20your%20Dockerfile%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFROM%20microsoft%2Fwindowsservercore%3C%2FP%3E%0A%3CP%3Eyou%20can%20append%20the%20tag%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFROM%20microsoft%2Fwindowsservercore%3A10.0.14393.576%3C%2FP%3E%0A%3CP%3EBut%20is%20still%20recommended%20to%20update%20the%20tag%20after%20a%20new%20Windows%20image%20has%20been%20published.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20find%20the%20tags%20for%20windowsservercore%20and%20nanoserver%20on%20the%20Docker%20Hub.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EWhat%20about%20the%20framework%20images%3F%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3ETypically%20you%20build%20your%20application%20on%20top%20of%20some%20kind%20of%20framework%20like%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttp%253A%252F%252Fasp.net%252F%26amp%3Bdata%3D02%257C01%257Ckhanna.mohit%2540microsoft.com%257Caf16da9f038d4d23690308d81774284a%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637285134983392211%26amp%3Bsdata%3DcKCjeT8hIksqIRV%252BS6y9CeW7nDmYoRc3VNKVmo%252FYPxY%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EASP.NET%3C%2FA%3E%2C%20IIS%20or%20a%20runtime%20language%20like%20Node.js%2C%20Python%20and%20so%20on.%20You%20should%20have%20a%20look%20at%20the%20update%20cycles%20of%20these%20framework%20images.%20The%20maintainers%20have%20to%20rebuild%20the%20framework%20images%20after%20a%20new%20release%20of%20the%20Windows%20base%20image%20came%20out.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20see%20some%20of%20your%20framework%20images%20lag%20behind%2C%20encourage%20the%20maintainer%20to%20update%20the%20Windows%20base%20image%20and%20to%20rebuild%20the%20framework%20image.%26nbsp%3B%20With%20such%20updated%20framework%20images%20-%20they%20hopefully%20come%20with%20a%20new%20version%20tag%20-%20you%20can%20rebuild%20your%20application.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1502551%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20general%20the%20recommendation%20is%20to%20use%20Automatic%20OS%20upgrade%20feature%20of%20Virtual%20Machine%20scale%20set%20as%20patching%20solution%20for%20Service%20Fabric%20in%20production%20refer%20to%20%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Fvirtual-machine-scale-sets-automatic-upgrade%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Fvirtual-machine-scale-sets-automatic-upgrade%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fservice-fabric%2Fservice-fabric-common-questions%23do-service-fabric-nodes-automatically-receive-os-updates%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fservice-fabric%2Fservice-fabric-common-questions%23do-service-fabric-nodes-automatically-receive-os-updates%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1502551%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Service%20Fabric%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

In general, the recommendation is to use Automatic OS upgrade feature of Virtual Machine scale set as patching solution for Service Fabric in production refer to (it needs durability of Silver and above for nodetype) :

https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automat...

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-common-questions#do-service-fab...

 

However in this approach updates can happen anytime (but will be rolling upgrade) i.e. when new images are published.  If you don't want this and need more control like schedule patching during non-peak time you can consider Patch Orchestration Application refer https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-patch-orchestration-application. Otherwise if you need total control like want to test updates in lower environments and then only patch prod, then you have to manually upgrade images refer : https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automat... or simply disable nodes one by one with intent restart and then update Windows and then enable node again

 

Important Notes: 

  • Ideally, when “enableAutomaticUpdates” is set to True, you are enabling windows updates i.e. patch upgrades, etc. (not the upgrade from 2012 to 2016). By default its True. These updates doesn't happen in rolling fashion. 
  • For scale sets using Windows virtual machines using automatic OS upgrade feature i.e enableAutomaticOSUpgrade set to True, starting with Compute API version 2019-03-01, the property virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates property must set to false in the scale set model definition. The above property enables in-VM upgrades where "Windows Update" applies operating system patches without replacing the OS disk. With automatic OS image upgrades enabled on your scale set, an additional update through "Windows Update" is not required. So if your using any patching solution in prod, Automatic OS Upgrade feature / Patch Orchestration Application / Manual OS upgrades, ideally you should be set enableAutomaticUpdates to false. 

If you are patching VMSS nodes you should also make sure the windows container which is running in VMSS nodes is patched and the windows version should be matched with VMSS node and the container.

 

In windows containers, its recommended that both should be patched to latest however host images using 1809 and above does not need to have matching revisions or if you are using Hyper-V isolation mode.  Refer to examples.  You can also refer to https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/update-container... for getting Container updates.

  

Windows Server containers currently don't support scenarios where Windows Server 2016-based containers run in a system where the revision numbers of the container host and the container image are different. For example, if the container host is version 10.0.14393.1914 (Windows Server 2016 with KB4051033 applied) and the container image is version 10.0.14393.1944 (Windows Server 2016 with KB4053579 applied), then the image might not start.

However, for hosts or images using Windows Server version 1809 and later, this rule doesn't apply, and the host and container image don't need to have matching revisions.

We recommend you keep your systems (host and container) up-to-date with the latest patches and updates to stay secure.

 

Example 1: The container host is running Windows Server 2016 with KB4041691 applied. Any Windows Server container deployed to this host must be based on the version 10.0.14393.1770 container base images. If you apply KB4053579 to the host container, you must also update the images to make sure the host container supports them.

 

Example 2: The container host is running Windows Server version 1809 with KB4534273 applied. Any Windows Server container deployed to this host must be based on a Windows Server version 1809 (10.0.17763) container base image, but doesn't need to match the host KB. If KB4534273 is applied to the host, the container images will still be supported, but we recommend you update them to address any potential security issues.

 

Container Patching 

In simple term in your case you have to update your docker file, working with containers is not the same as working with real servers or VM's you support for months or years. A container image is a static snapshot of the filesystem (and Windows registry and so on) at a given time.

 

Container images have layers

First have a look how a container image looks like. It is not just a snapshot. A container image consist of multiple layers. When you look at your Dockerfile you normally use a line like FROM microsoft/windowsservercore.

 

Your container image then uses the Windows base image that contains a layer with all the files needed to run Windows containers.

 

If you have some higher level application you may use other prebuilt container images like FROM microsoft/iis or FROM microsoft/aspnet. These images also re-use the FROM microsoft/windowsservercore as base image.

image1.png

 

On top of that you build your own application image with your code and content needed to run the application in a self contained Windows container.

 

Behind the scenes your application image now uses several layers that will be downloaded from the Docker Hub or any other container registry. Same layers can be re-used for different other images. If you build multiple ASP.NET applications as Docker images they will re-use the same layers below.

 

But now back to our first question: How to apply Windows Updates in a container image?

 

The Windows base images

Let's have a closer look at the Windows base images. Microsoft provides two base images: windowsservercore and nanoserver. Both base images are updated on a regular basis to roll out all security fixes and bug fixes. You might know that the base image for windowsservercore is about 4 to 5 GByte to download.

 

So do we have to download the whole base image each time for each update?

 

If we look closer how the base images are built we see that they contain two layers: One big base layer that will be used for a longer period of time. And there is a smaller update layer that contains only the patched and updated files for the new release.

image2.gif

 

So updating to a newer Windows base image version isn't painful as only the update layer must be pulled from the Docker Hub.

 

But in the long term it does not make sense to stick forever to the old base layer. Security scanners will mark them as vulnerable and also all the images that are built from them. And the update layer will increase in size for each new release. So from time to time there is a "breaking" change that replaces the base layer and a new base layer will be used for upcoming releases. We have seen that with the latest release in December.

 

image3.gif

 

 

From time to time you will have to download the big new base layer which is about 4 GByte for windowsservercore (and only about 240 MByte for nanoserver, so try to use nanoserver whereever you can) when you want to use the latest Windows image release.

 

Keep or Update ?  Should I avoid updating the Windows image to revision 576 to keep my downloads small? No!

 

Recommendation is to update all your Windows container images and rebuild them with the newest Windows image. You have to download that bigger base layer also only once and all your container images will re-use it.

 

Perhaps your application code also has some updates you want to ship. It's a good time to ship it on top of the newest Windows base image. So is recommended to run

 

docker pull microsoft/windowsservercore

docker pull microsoft/nanoserver

before you build new Windows container images to have the latest OS base image with all security fixes and bug fixes in it.

 

If you want to keep track which version of the Windows image you use, you can use the tags provided for each release.

 

Instead of using only the latest version in your Dockerfile

 

FROM microsoft/windowsservercore

you can append the tag

 

FROM microsoft/windowsservercore:10.0.14393.576

But is still recommended to update the tag after a new Windows image has been published.

 

You can find the tags for windowsservercore and nanoserver on the Docker Hub.

 

What about the framework images?

Typically you build your application on top of some kind of framework like ASP.NET, IIS or a runtime language like Node.js, Python and so on. You should have a look at the update cycles of these framework images. The maintainers have to rebuild the framework images after a new release of the Windows base image came out.

 

If you see some of your framework images lag behind, encourage the maintainer to update the Windows base image and to rebuild the framework image.  With such updated framework images - they hopefully come with a new version tag - you can rebuild your application.