æè¿ã¯ã¾ã Windows Server Containers ã®å®éç¨ã«é¢ãã¦ãããããã¨èããã調ã¹ãããã¦ããã®ã§ãããWindows ã§ã¯çµ¶å¯¾ã«é¿ããããªããã®ã¨ã㦠Windows Update ãããã¾ãã
ããã¦ç¾æç¹ã§ã® Windows Server Containers ã«ã¯ä»¥ä¸ã®ãããªè¦ä»¶ãããã¾ãã
Windows Server ã³ã³ããã¼ã¯ããã«ãçªå·ãç°ãªãã¨èµ·åããããã¯ããã¾ã (ä¾: 10.0.14300.1030 (Technical Preview 5) 㨠10.0.14393 (Windows Server 2016 RTM))ã ãã«ãçªå·ãä¸è´ãããªãã¸ã§ã³çªå·ãç°ãªãå ´åã¯ãèµ·åããããã¯ããã¾ãã (ä¾: 10.0.14393 (Windows Server 2016 RTM) 㨠10.0.14393.206 (Windows Server 2016 GA))ã ãã ããæè¡çã«ã¯ãããã¯ããã¾ããããããã¯ç¶æ³ã«ãã£ã¦ã¯æ£ããæ©è½ããªãå¯è½æ§ãããæ§æã§ãããããéç¨ç°å¢ã§ã¯ãµãã¼ãã§ãã¾ããã
Windows コンテナーの要件 | Microsoft Docs
ããã¥ã¡ã³ãã®å 容ã解éããã¨ãWindows Server Containers ã§ã¯ãªãã¸ã§ã³ã¾ã§ãã¹ãã¨ã³ã³ããã®ãã¼ã¸ã§ã³ãä¸è´ãããªãã¨ãæ£ããåããªãå¯è½æ§ããããéç¨ç°å¢ã§ã¯å®è³ªä½¿ããªãã¨ãããã¨ã§ãããã
ãã㧠Docker ã®ç½ ãåºã¦ããããã§ããæ®éã« microsoft/windowsservercore ã¨æå®ãã㨠latest ã¿ã°ã®ã¤ã¡ã¼ã¸ãè½ã¡ã¦ããã®ã§ããªãã¸ã§ã³ã¯ãã®æã®ææ°ã«ãªãåºå®ã§ãã¾ãããç¾æç¹ã§ã¯é¢åã§ãã¿ã°ã¾ã§ã¡ããã¨æå®ããã¹ãã¨ãããã¨ãªã®ã§ãããã
# Windows Server Core ã®ã¤ã¡ã¼ã¸ãå©ç¨ãã FROM microsoft/windowsservercore:10.0.14393.953 # IIS ã¾ã§ã¤ã³ã¹ãã¼ã«ãããã¤ã¡ã¼ã¸ãå©ç¨ãã FROM microsoft/iis:windowsservercore-10.0.14393.953 # ASP.NET 4.6.2 ã¾ã§ã¤ã³ã¹ãã¼ã«ãããã¤ã¡ã¼ã¸ãå©ç¨ãã FROM microsoft/aspnet:4.6.2-windowsservercore-10.0.14393.953
å½ç¶ãªãã Windows Update ã§ãªãã¸ã§ã³ãå¤ãã£ãå ´åã«ã¯ãåæ§ã«å¤æ´ããå¿ è¦ãããã¾ãã
ãªã³ãã¬ã®ä»®æ³ç°å¢ã§ããã°ãèªåã§ãã¼ã¸ã§ã³ãã¢ãããã¼ãã®ã¿ã¤ãã³ã°ãããç¨åº¦æ±ºããããã®ã§ latest ã§ãè¯ããããããªãã§ãããAzure ã AWS ã®å ´åã¯å°ã注æãå¿ è¦ããã§ãã
Azure ã®å ´å
Azure ã«ãã Windows Server 2016 with Containers ãå©ç¨ããã¨ãäºã Windows Server Core 㨠Nano Server ã pull ãããç¶æ ã§èµ·åãããã¨ãåºæ¥ã¾ãããã¿ã°ã latest ã«ãªã£ã¦ããã®ã§æ±ãã«ããã§ãã
æè¿ã® Windows Server Core ã ã¨å¤å°ã¯å·®åãå©ç¨ãããã¿ãããªã®ã§ã5GB è½ã¨ãç´ãã«ã¯ãªããªãã¿ããã§ããæéã¯ãããã¾ãã
Dockerfile 㧠latest ãæå®ããã¤ã¡ã¼ã¸ãå®è¡ãããã¨ããã¨ãã¤ã¡ã¼ã¸ãä½æããæç¹ã§ã® latest ã«ãªãã®ã§å¥è·¡çã«ãã¼ã¸ã§ã³ãä¸è´ãã¦ããªã㨠pull ãç´ãã«ãªã£ã¦ãã¾ãããã§ãã
ããæå³å ¬å¼ã§ãã Azure VM ã®ã¤ã¡ã¼ã¸ãããã ã¨ãæ£ç´ãªã¨ããä¸å®ã«ãªã£ã¦ãã¾ãã
AWS ã®å ´å
EC2 ã® Windows Server 2016 Base with Containers ã§ã¯ã¤ã¡ã¼ã¸ã pull ããã¦ããªãã®ã§ããã®ã¾ã¾ ECS ã®ãã¼ã¹ã¤ã¡ã¼ã¸ã¨ãã¦ä½¿ãã¨å ¨ã¦ã®ã¤ã³ã¹ã¿ã³ã¹ã§ pull ãèµ°ã£ã¦ãã¾ã£ã¦æéããããã¾ãã
äºã pull æ¸ã¿ã® AMI ãä½ã£ã¦ãããæ¹ãè¯ãããã§ããUser Data 㧠pull 㨠sysprep ã¾ã§ãããã¾ãã
function Get-OSVersion() { $buildLabEx = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\').BuildLabEx $osBuild = $buildLabEx.Substring(0, $buildLabEx.IndexOf(".", 6)) return "10.0." + $osBuild } docker pull microsoft/windowsservercore:$(Get-OSVersion) docker pull microsoft/iis:windowsservercore-$(Get-OSVersion) docker pull microsoft/aspnet:4.6.2-windowsservercore-$(Get-OSVersion) docker pull microsoft/nanoserver:$(Get-OSVersion) docker pull microsoft/iis:nanoserver-$(Get-OSVersion) cd "$env:ProgramData\Amazon\EC2-Windows\Launch\Scripts" .\InitializeInstance.ps1 -Schedule .\SysprepInstance.ps1
ãã¹ãã¨ã³ã³ããã®ãã¼ã¸ã§ã³ã¯åãããå¿ è¦ãããã®ã§ãé å¼µã£ã¦ã¬ã¸ã¹ããªããåå¾ããããã«ãã¦ãã¾ããECS ã¯ã©ã¹ã¿ã¼ãä½æããã®ã¯é¢åã ã£ãã®ã§ãæ®éã« EC2 ã®ã¤ã³ã¹ã¿ã³ã¹ãç«ã¡ä¸ãã¾ããã
docker images ãå®è¡ããã¨ãåãã¼ã¹ã¨ãªãã¤ã¡ã¼ã¸ã pull æ¸ã¿ã«ãªã£ã¦ããã®ã確èªã§ãã¾ãã
AMI ã§ç¨æããã¦ãã Windows Server 2016 ã®ãã¼ã¸ã§ã³ã¨åãã«ãªã£ã¦ãããã¨ã確èªã§ãã¾ããã
課é¡ã¨ãã¦ã¯ Windows Update ã®ã¿ã¤ãã³ã°ã§ãªãã¸ã§ã³ãä¸ããã¨ããç¹ã§ãããããã°ã£ãã㯠Windows Update ã®æã« AMI ãä½ãç´ãã¦å ¥ãæ¿ããããããããªãæ°ããã¾ããã
ãªãã¸ã§ã³ãã¾ã§æå®ããªãã¨ãããªãã®ã¯é常ã«æ±ãã«ããã§ãããã«ã¼ãã«ãå ±æãã¦ãã以ä¸ä»æ¹ãªãé¨åã ã¨æãã¾ãããdocker pull ãè³¢ããªãã°ã¾ãã«ãªããããããªãã§ãããä»ã¯ããã§ç²¾ãã£ã±ãã