ä»å¹Žã®åãïŒ2014幎é ïŒã«ãåã¿ã¹ã¯ãIronWorkerã§ç¬èªã®Dockerã³ã³ãããŒå ã§å®è¡ããããšã«ããŸããã ãã以æ¥ãã¯ã©ãŠãå ã®ç¬èªã®Dockerã³ã³ããå ã§3å以äžã®ããã°ã©ã ãéå§ããŠããŸãã
æ°ã¶æ䜿çšããåŸãDockerã«åºã¥ããŠã€ã³ãã©ã¹ãã©ã¯ãã£ãæ§ç¯ããéã«çŽé¢ããããã€ãã®èª²é¡ãããããå æããæ¹æ³ãããã³äŸ¡å€ãããçç±ãã³ãã¥ããã£ãšå ±æããããšæããŸãã
IronWorkerã¯ãéçºè ãã€ã³ãã©ã¹ãã©ã¯ãã£ã®äœæãšä¿å®ãæ°ã«ããã«ã¿ã¹ã¯ãèšç»ãåŠçãããã³ã¹ã±ãŒãªã³ã°ã§ããã¿ã¹ã¯å®è¡ãµãŒãã¹ã§ãã 3幎以äžåã«ãµãŒãã¹ãéå§ãããšãããã¹ãŠã®èšèªãšããã±ãŒãžãå«ãå¯äžã®LXCã³ã³ããã䜿çšããŠã¿ã¹ã¯ãéå§ããŸããã Dockerã䜿çšãããšãäžé£ã®ã³ã³ãããŒãç°¡åã«æŽæ°ããã³ç®¡çã§ããããã«ãªããŸãããããã«ãããã¯ããã«åºç¯ãªèšèªç°å¢ãšã€ã³ã¹ããŒã«æžã¿ããã±ãŒãžã顧客ã«æäŸã§ããŸãã
ããã€ãã®ãã°ã«æ°ã¥ããDockerããŒãžã§ã³0.7.4ã§äœæ¥ãéå§ããŸããïŒæ倧ã®1ã€-ã³ã³ãããé©åã«éããããªãã£ããã ãåŸã§ä¿®æ£ãããŸããïŒã ã»ãŒãã¹ãŠãå æããDockerãããŒãºãæºããã ãã§ãªããæåŸ ãã¯ããã«è¶ ããŠããããšãåŸã ã«çºèŠããã€ã³ãã©ã¹ãã©ã¯ãã£å šäœã§Dockerã®äœ¿çšç¯å²ãæ¡å€§ããŸããã ä»æ¥ã®çµéšãèãããšãããã¯çã«ããªã£ãŠããŸãã
ã¡ãªãã
ããã«ãç§ãã¡ãèŠãããã€ãã®å©ç¹ã®ãªã¹ãã瀺ããŸãã
æ°ãå°ãªã
ã€ã¡ãŒãžã®æŽæ°ãšãµããŒããç°¡å
Dockerã®gitã¢ãããŒãã¯éåžžã«åŒ·åã§ãããåžžã«å±éãããŠããå€æ°ã®ç°å¢ãç°¡åã«ç®¡çã§ããŸãããŸããã€ã¡ãŒãžç®¡çã·ã¹ãã ã«ãããåã ã®ã€ã¡ãŒãžã®è©³çŽ°ã埮調æŽããŠãã£ã¹ã¯é åãç¯çŽã§ããŸãã ããã«æŽæ°ãããèšèªã«å¯Ÿå¿ã§ããããã«ãªããŸããããŸããã¡ãã£ã¢åŠçå°çšã«èšèšãããæ°ããFFmpegã¹ã¿ãã¯ãªã©ã®ç¹å¥ãªç»åãæäŸããããšãã§ããŸãã çŸåšãçŽ15ã®ç°ãªãã¹ã¿ãã¯ãããããã®ãªã¹ãã¯æ¥éã«å¢å ããŠããŸãã
ãªãœãŒã¹ã®å²ãåœãŠãšåæ
LXCã³ã³ãããŒã¯ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã¬ãã«ã§ã®ä»®æ³åææ³ã§ãããã³ã³ãããŒãã³ã¢ãã³ã¢éã§åå²ã§ããããã«ããŸãããããã»ããµãŒãã¡ã¢ãªãŒãå ¥åºåããã€ã¹ãªã©ã®äžå®éã®ãªãœãŒã¹ã®äœ¿çšã§åã³ã³ãããŒãå¶éã§ããããã«ããŸãã Dockerã¯ãREST APIãããŒãžã§ã³ç®¡çã·ã¹ãã ãã€ã¡ãŒãžã®æŽæ°ãããŸããŸãªã¡ããªãã¯ãžã®ç°¡åãªã¢ã¯ã»ã¹ãªã©ãä»ã®å€ãã®æ©èœãšåæ§ã«ãããã®æ©èœãæäŸããŸãã ããã«ãDockerã¯ãCoWãã¡ã€ã«ã·ã¹ãã ã䜿çšããŠããŒã¿ãåé¢ããããå®å šãªæ¹æ³ããµããŒãããŠããŸã ã ããã¯ãã¿ã¹ã¯ã®äžéšãšããŠãã¡ã€ã«ã«å ãããããã¹ãŠã®å€æŽãåå¥ã«ä¿åãããåäžã®ã³ãã³ãã§ã¯ãªã¢ã§ããããšãæå³ããŸãã LXCã¯ãã®ãããªå€æŽã远跡ã§ããŸããã
ç°¡åãªDockerfilesçµ±å
ç§ãã¡ã®ããŒã ã¯äžçäžã«æ£ãã°ã£ãŠããŸãã ã·ã³ãã«ãªDockerfileãå ¬éããèœã¡çããŠæããããšãã§ãããšããäºå®ã¯ãç§ãã¡ãç®ãèŠãŸããšãä»ã®èª°ããããªããšãŸã£ããåãç»åãåéã§ããããšãç¥ã£ãŠãã-ç§ãã¡ãšç§ãã¡ã®ç¡ç ã¢ãŒãã®å€§ããªå©çã§ãã ãŸããã¯ãªãŒã³ãªã€ã¡ãŒãžã䜿çšãããšãå±éãšãã¹ããã¯ããã«é«éã«ãªããŸãã ç§ãã¡ã®éçºãµã€ã¯ã«ã¯ãã£ãšéããªãããã¹ãŠã®ããŒã ã¡ã³ããŒã¯ãã£ãšå¹žãã«ãªããŸããã
Dockerã§æ§ç¯ãããã«ã¹ã¿ã ç°å¢
æé·ããã³ãã¥ããã£
Dockerã®æŽæ°ã¯éåžžã«é »ç¹ã«å ¬éãããŸãïŒChromeãããé »ç¹ã«æŽæ°ãããŸãïŒã æ°ããæ©èœã®è¿œå ãšãã°ã®ä¿®æ£ã«å¯Ÿããã³ãã¥ããã£ã®é¢äžã®åºŠåãã¯æ¥éã«é«ãŸã£ãŠããŸãã ç»åã®ãµããŒããDockerèªäœã®æŽæ°ãDockerãšé£æºããããã®è¿œå ããŒã«ã®è¿œå ãªã©ããããã®åé¡ã«å¯ŸåŠããåªç§ãªäººãããããããã®ã§ããã®å¿ èŠã¯ãããŸããã Dockerã³ãã¥ããã£ã¯éåžžã«ååãã§ããã Dockerã³ãã¥ããã£ã«åå ããããšã§å€ãã®ã¡ãªãããããããããããšãããããŸãã
Docker + CoreOS
ç§ãã¡ã¯ãŸã ç 究ããã»ã¹ã«ãããŸãããDockerãšCoreOSã®çµã¿åããã¯ãã¹ã¿ãã¯ã®äžã§éèŠãªäœçœ®ãå ããããšãçŽæããŸãã Dockerã¯ãå®å®ããã€ã¡ãŒãžç®¡çãšã³ã³ãããŒåãæäŸããŸãã CoreOSã¯ãç°¡çŽ åãããã¯ã©ãŠãOSãåæ£ç®¡çãæ§æ管çãæäŸããŸãã ãã®çµã¿åããã«ãããåé¡ãããè«ççã«åé¢ããçŸåšãããåªããã€ã³ãã©ã¹ãã©ã¯ãã£ã¹ã¿ãã¯ãå®çŸã§ããŸãã
æ¬ ç¹
ç¹ã«ã¹ã±ãŒãªã³ã°ã®å ŽåãåãµãŒããŒãã¯ãããžãŒã¯åŸ®èª¿æŽãå¿ ââèŠã§ãããDockerãäŸå€ã§ã¯ãããŸããã ïŒ1ãæã«çŽ5,000äžã®ã¿ã¹ã¯ãš500,000æéã®ããã»ããµæéãå®è¡ããå©çšå¯èœã«ããã€ã¡ãŒãžããã°ããæŽæ°ãããšããŸããïŒ
倧容éã§Dockerã䜿çšãããšãã«çºçããããã€ãã®åé¡ã以äžã«ç€ºããŸãã
Dockerãšã©ãŒ-å°ããä¿®æ£å¯èœ
éå®çãªäžäœäºææ§
éãããŒã¹ã§ã®éçºã¯ç¢ºãã«å©ç¹ã§ãããæ¬ ç¹ããããŸãã ãããã®1ã€ã¯ãäžäœäºææ§ã«å¶éããããŸãã ã»ãšãã©ã®å Žåãçºçããã®ã¯ã³ãã³ãã©ã€ã³æ§æãšAPIã¡ãœããã®å€æŽã§ãããããããã¯çç£ã®èŠ³ç¹ããã¯ããã»ã©éèŠãªåé¡ã§ã¯ãããŸããã
ãã ããä»ã®ã±ãŒã¹ã§ã¯ããããããã©ãŒãã³ã¹ã«åœ±é¿ãäžããŠããŸãã ããšãã°ãã³ã³ããã®èµ·ååŸã«Dockerãšã©ãŒãçºçããå ŽåãSTDERRãåæãããšã©ãŒã®çš®é¡ã«å¿ããŠå¯Ÿå¿ããŸãïŒããšãã°ãã¿ã¹ã¯ãå床å®è¡ããããšããŸãïŒã æ®å¿µãªããããšã©ãŒåºå圢åŒã¯ããŒãžã§ã³ããšã«å€æŽãããããããã®å Žã§ãããã°ãè¡ãããšã«ããŸããã
ãããã®åé¡ã解決ããã®ã¯æ¯èŒçç°¡åã§ãããããã¯ãã¹ãŠã®æŽæ°ãæ°åãã§ãã¯ããå¿ èŠãããããšãæå³ããå€æ°ã®äžçã«ãªãªãŒã¹ãããŸã§ããªãã¯ãŸã ãããŸãã§ãã æ°ãæåã«ããŒãžã§ã³0.7.4ã§éå§ããæè¿ã·ã¹ãã ãããŒãžã§ã³1.2.0ã«æŽæ°ãããã®åéã§å€§ããªé²æ©ãèŠãããããšã«æ³šæããŠãã ããã
éãããããŒã«ãšã©ã€ãã©ãª
Dockerã«ã¯4ãæåã«å®å®ãããªãªãŒã¹ããããŸããããDockerçšã«äœæãããããŒã«ã®å€ãã¯ãŸã äžå®å®ãªãŸãŸã§ãã Dockerã·ã¹ãã ã§å€æ°ã®ããŒã«ã䜿çšããããšã¯ã倧ããªãªãŒããŒãããã®æ¡çšãæå³ããŸãã æ°ããæ©èœãèæ ®ããŠãšã©ãŒãä¿®æ£ããããã«ãããŒã ã®èª°ãããã¹ãŠãææ°ã®ç¶æ ã«ä¿ã¡ãäœåºŠã調æŽããå¿ èŠããããŸãã ãã ããDockerçšã«äœæãããå€ãã®ããŒã«ãæ°ã«å ¥ã£ãŠããããããã®æŠãã«åã£ãã®ã誰ãªã®ãåŸ ã¡ãããŸããïŒã€ã³ãã©ã¹ãã©ã¯ãã£ç®¡çãèŠãŠïŒã ç¹ã«é¢å¿ãããã®ã¯ãetcdãfleetãkubernetesã§ãã
å°é£ãä¹ãè¶ãã
ç§ãã¡ã®çµéšãããå°ãæ·±ãæããã«ããããã«ãç§ãã¡ãééããåé¡ãšãã®è§£æ±ºçã®ããã€ãã以äžã«ç€ºããŸãã
ãããã°ã»ãã·ã§ã³ããã®æç²
ãã®ãªã¹ãã¯ãIronWorkerã®äž»èŠãªéçºè ã§ãããã€ã³ãã©ã¹ãã©ã¯ãã£ç®¡çã®ãã£ã¬ã¯ã¿ãŒã§ããRoman KononovãšãDockerã§ã®äœæ¥ã®ãããã°ãšæé©åã§éèŠãªåœ¹å²ãæããSam Wardã«ãã£ãŠæäŸãããŸããã
DockerãŸãã¯ãã®ä»ã®ã·ã¹ãã ã®åé¡ã«é¢é£ãããšã©ãŒã«ãªããšããŠãŒã¶ãŒã«åœ±é¿ãäžããããšãªãã¿ã¹ã¯ãèªåçã«ååŠçã§ããããšã«æ³šæããŠãã ããïŒååŠçã¿ã¹ã¯-çµã¿èŸŒã¿ãã©ãããã©ãŒã æ©èœïŒã
é·æéã®åãå€ãããã»ã¹
ã³ã³ããã®åãå€ãã«æéããããåé¡ã®è§£æ±º
ã³ã³ããã®åé€ã«ã¯æéãããããããå€ãã®èªã¿åã/æžã蟌ã¿æäœãå¿ èŠã§ãã ããã«ãããå€§å¹ ãªé 延ãçºçããã·ã¹ãã ã®è匱æ§ãæããã«ãªããŸããã 䜿çšå¯èœãªã³ã¢ã®æ°ãå¢ããå¿ èŠããããŸããããããã¯å¿ èŠãããŸããã§ããã
devicemapperïŒDockerãã¡ã€ã«ã·ã¹ãã ãã©ã€ããŒïŒã調ã¹ãŠèª¿æ»ããçµæãç¹å¥ãªãªãã·ã§ã³ `--storage-opt dm.blkdiscard = false`ãèŠã€ãããŸããã ãã®ãªãã·ã§ã³ã¯ãã³ã³ãããåé€ãããšãã«ãéããã£ã¹ã¯æäœãã¹ãããããããã«Dockerã«æ瀺ããŸããããã«ãããã³ã³ããã®åæããã»ã¹ãå€§å¹ ã«é«éåãããŸãã ãã以æ¥ãåé¡ã¯è§£æ±ºãããŸããã
ããŠã³ãã§ããªãããªã¥ãŒã
Dockerãããªã¥ãŒã ãé©åã«ã¢ã³ããŠã³ãããªãã£ããããã³ã³ãããŒã¯æ£ããã·ã£ããããŠã³ããŸããã§ããã ãã®ãããã¿ã¹ã¯ãå®äºããåŸã§ããã³ã³ããã¯ãã³ã¹ãããã§æ©èœããŸããã å¥ã®æ¹æ³ã¯ãæšæºã¹ã¯ãªããã®ã»ããã䜿çšããŠããªã¥ãŒã ãã¢ã³ããŠã³ããããã©ã«ããŒãæ瀺çã«åé€ããããšã§ãã 幞ããªããšã«ãDocker v0.7.6ã䜿çšããã®ã¯ããªãåã®ããšã§ãã ãã®ã¢ã³ããŠã³ãã®åé¡ã¯DockerããŒãžã§ã³0.9.0ã§è§£æ±ºãããããããã®é·ãã¹ã¯ãªãããåé€ããŸããã
ã¹ã¿ãã¯äœ¿çšéã®ååž
ã¡ã¢ãªå¶éã®åãæ¿ã
DockerãªãªãŒã¹ã®1ã€ã§ãã¡ã¢ãªãå¶éããæ©èœãçªç¶è¿œå ãããLXCãªãã·ã§ã³ãåé€ãããŸããã ãã®çµæãã¯ãŒã¯ãããŒã®äžéšãã¡ã¢ãªå¶éãè¶ ããã·ã¹ãã å šäœãå¿çããªããªããŸããã ãµããŒããããŠããªããªãã·ã§ã³ã䜿çšããŠããŠããDockerãç Žæããããšã¯ãªããããããã«ã¯é©ããŸããã ãããä¿®æ£ããã®ã¯é£ãããããŸããã§ãã-Dockerã§ã¡ã¢ãªå¶éãé©çšããŸã-ãããããã¹ãŠåãããã«ãå€æŽã¯é©ããŸããã
ä»åŸã®èšç»
æ¢ã«ãæ°ä»ãã®ããã«ãç§ãã¡ã¯Dockerã«éåžžã«ç©æ¥µçã«æè³ãããããæ¯æ¥ç¶ããŠããŸãã IronWorkerã§ã«ã¹ã¿ã ã³ãŒããå®è¡ããããã®ã³ã³ãããšããŠäœ¿çšããããšã«å ããŠãç§ãã¡ã¯ããžãã¹ã®ä»ã®å€ãã®é åã«ãããå°å ¥ããéçšã«ãããŸãã
ãããã®é åã¯æ¬¡ã®ãšããã§ãã
éå·¥ããã¯ãšã³ã
Dockerãã¿ã¹ã¯ã®ã³ã³ãããŒãšããŠäœ¿çšããããšã«å ããŠãäœæ¥ã¿ã¹ã¯ãå¶åŸ¡ããã³å®è¡ããåãµãŒããŒã®åŠç管çããŒã«ãšããŠDockerãå®è£ ããŠããŸãã ïŒåã¢ãŒãã£ã¹ãã®ã¡ã€ã³ã¿ã¹ã¯ã¯ããã¥ãŒããã¿ã¹ã¯ãååŸããDockerãé©åãªç°å¢ã«ããŒãããã¿ã¹ã¯ãå®è¡ããŠå¶åŸ¡ããã¿ã¹ã¯ã®å®äºåŸãç°å¢ãã¯ãªã¢ããŸããïŒåãè»ã IronWorkerã€ã³ãã©ã¹ãã©ã¯ãã£å šäœãDockerã³ã³ããã«ç§»åãããšãCoreOSã§ããããç°¡åã«å®è¡ã§ããŸãã
IronWorkerãIronMQãããã³IronCache API
ãã¥ãŒãã³ã°ãšãããã€ã奜ãŸãªãä»ã®éçºããŒã ãšéãã¯ãããŸããã ãããã£ãŠããã¹ãŠã®ãµãŒãã¹ãDockerã³ã³ãããŒã«ããã¯ããŠãã·ã³ãã«ã§äºæž¬å¯èœãªäœæ¥ç°å¢ãäœæã§ããããšãéåžžã«å¬ããæããŸãã ãµãŒããŒãæ§æããå¿ èŠã¯ãªããªããŸããã å¿ èŠãªã®ã¯ãDockerã³ã³ãããå®è¡ã§ãããµãŒããŒã ãã§ãã ãŸãããã«ããµãŒããŒïŒç¹å®ã®ç°å¢ã§ãœãããŠã§ã¢è£œåã®ãªãªãŒã¹ããã«ããããµãŒããŒïŒãDockerã³ã³ãããŒã«çœ®ãæããŠããããšã«ã泚æããŠãã ããã ããã§ã®å©ç¹ã¯ãæè»æ§ãé«ããã¹ã¿ãã¯ãã·ã³ãã«ã§ä¿¡é Œæ§ãé«ãããšã§ãã é£çµ¡ãåãåããŸãããã
ã¯ãŒã«ãŒã®çµã¿ç«ãŠãšèªã¿èŸŒã¿
ãŸããDockerã³ã³ããã䜿çšããŠIronWorkerã§ã¿ã¹ã¯ãäœæããã³ããŒãããå®éšãè¡ã£ãŠããŸãã ããã§ã®å€§ããªå©ç¹ã¯ãç¹å®ã®ã¿ã¹ã¯ã®ããŒãããã»ã¹ãšã¯ãŒã¯ããã»ã¹ãã«ã¹ã¿ãã€ãºããããŒãããŠããå®è¡ããã³ã¹ã±ãŒãªã³ã°ãã䟿å©ãªæ¹æ³ããŠãŒã¶ãŒã«æäŸããããšã§ãã ããã§ã®ãã1ã€ã®å©ç¹ã¯ããŠãŒã¶ãŒããµãŒãã¹ãšåãç°å¢ã§ã¯ãŒã«ãŒãããŒã«ã«ã§ãã¹ãã§ããããšã§ãã
ãªã³ãã¬ãã¹ãã«ããå®è£ ãã
IronMQ Enterpriseã®ææ°ããŒãžã§ã³ã®äž»èŠãªé åžæ¹æ³ãšããŠDockerã䜿çšãããšãäœæ¥ãç°¡çŽ åãããäºå®äžããããã¯ã©ãŠãç°å¢ã«ãããã€ããããã®ã·ã³ãã«ã§æ±çšæ§ã®é«ãæ¹æ³ãæäŸãããŸãã ã¯ã©ãŠãã§å®è¡ãããµãŒãã¹ã«å ããŠããã¹ãŠã®ã¯ã©ã€ã¢ã³ãã«ã¯Dockerã³ã³ãããŒãå®è¡ã§ãããµãŒããŒãå¿ èŠã§ããããã¹ããŸãã¯éçšç°å¢ã§æ¯èŒçç°¡åã«ãã«ããµãŒããŒã¯ã©ãŠããµãŒãã¹ãååŸã§ããŸãã
çç£ä»¥é
ãã¯ãããžãŒã®é²åïŒdocker.comããå ¥æïŒ
éå»1幎åã«ããã£ãŠããœãã¢ã³ãã€ã¯ã¹ãGoSFããŒãã¢ããã§ãã¢ããŒãžã§ã³ã玹ä»ããŠä»¥æ¥ãDockerã¯å€§ããªé²æ©ãéããŸããã ããŒãžã§ã³1.0ã®ãªãªãŒã¹ä»¥æ¥ãDockerã¯éåžžã«å®å®ããŠãããå®çšŒåã®æºåãæŽã£ãŠããããšãå®èšŒãããŠããŸãã
Dockerã®éçºã¯éåžžã«å°è±¡çã§ãã äžèšã®ãªã¹ããããããããã«ãæ°ããæ©äŒã楜ãã¿ã«ããŠããŸãããçŸåšã®æ©èœã«ãæºè¶³ããŠããŸãã
DockerããŒã¹ã®ã€ã³ãã©ã¹ãã©ã¯ãã£ç®¡çããŒã«ãå ¥æã§ããå Žåã®ã¿ã