æè¿ããååãèãããã«ãªã£ãDockerã触ã£ã¦ã¿ãã
Docker 㯠LXC 㨠AUFS ã使ã£ãã³ã³ããåã®ä»®æ³åã½ããã¦ã§ã¢ã
PaaS ã® dotCloud ãèªç¤¾ã§ä½¿ã£ã¦ããæè¡ããªã¼ãã³ã½ã¼ã¹ã¨ãã¦ä»å¹´ã®å¤ã«ãªãªã¼ã¹ãã¦ããã
(dotCloud 㯠docker inc. ã«ç¤¾åå¤æ´ãã¦ã)
ã¡ãã£ã¨åã« @sowawa ãFacebookã§æ¸ãã¦ããã®ãè¦ã¦æèãã¯ããã¦ãæ¨æ¥ã® id:shiba_yu36 ã®ã¨ã³ããªã®æµããã¿ã¦ãã¦ããã£ã¦ã¿ããã¨è§¦ã£ã¦ããæã«ãªã£ã¦ãã¦ãä»äºé²ãã§ãªãã Ruby Advent Calendar ã®ãã¿ãã¿ã¤ãã£ã¦ãªãã£ããããããã®ã§èª¿ã¹ãæ
å ±ãã¡ã¢ãã¦ããã
調ã¹ã¦ã¿ã
æåã«èªãã ããã®ã¨ãã«ã¯ã¾ã ãã¾ãã©ããªãã®ãç解ã§ãã¦ããªãã
Docker ã¨ã¯ãªãããã¨ããã®ã¯æ¤ç´¢ãã¦ã¾ãç®ã«ã¤ãããã®è¨äºã§ã¤ããã§ãµããµãã¨è¨ã£ã¦ããã
次ã«ãã®è¨äºã«æ²¿ã£ã¦ä¸éãåããã¦ã¿ãã
Vagrant ã Rubygems ã§æä¾ããã¦ããã¨ããã触ã£ã¦ããªãã®ããã¬ãæ¡ä»¶ã ããvagrant up
ãããã¨ã©ã¼ã«ãªã£ã¦ã調ã¹ããã ãã¶å¤ãã£ãã®ã§å
¬å¼ã®ããã±ã¼ã¸ããã¤ã³ã¹ãã¼ã«ããã
rbenv
ã§è¤æ°ã® Ruby ã®ãã¼ã¸ã§ã³ã«ã¤ã³ã¹ãã¼ã«ãã¦ããã®ã§åRubyã®ãã¼ã¸ã§ã³ãã Vagrant ãæ¶ããªã㨠shim
ãæ¶ãã¦ãããªãã¦ãvagrant
ã³ãã³ãã gem ã®æ¹ãåç
§ãã¦ã¦ã¤ããã£ãã
CoreOS ã¯å¤§è¦æ¨¡ã¤ã³ãã©åãã®è¶
軽éãªLinuxã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã§ãããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãããã§ããã«ãªããã¹ãªã©ã§å£ãã¦ããªããã¨ãä¿è¨¼ã§ããããã«ãªã£ã¦ãããããã¤ã沢山ã®ãã¼ãã«ãã©ã¾ãã¦ããã®ä¸ã§å¿
è¦ãª Docker ã®ã³ã³ãããç«ã¡ä¸ãã¦ãä¸è¦ã«ãªã£ããã³ã³ãããæ¨ã¦ãã(ãããImmutable Infrastructureã ã¨èªèãã¦ããã©ééã£ã¦ã¾ãã)
vagrant up
以éã¯ã¨ãã«ã²ã£ãããããªãä½é¨ã§ããã
ã¡ãã£ã¨è©³ããåå¼·ããã®ã«ãããèªãã§æ¦è¦ãã¤ããã ã
ãã®è¾ºã¾ã§ããã¨ãªãã¨ãªãåã£ã¦ããã®ã§ãå
¬å¼ã®ãã¥ã¼ããªã¢ã«ããã£ã¦ã¿ããæåã«ãããããã¹ãã ããã©ãè±èªãããã¯ã§ããæ°ã失ããããªã®ã§æ¥æ¬èªã®æ
å ±ããå½ã£ãã
ãã®ãã¥ã¼ããªã¢ã«ã¯ããã§ãã¦ãã¦ã1ã¤1ã¤è©¦ããªããæä½ãè¦ãããããåºæ¬æä½ã®ãã¨ã«ã¯ãDockerfile
ã®ãã¥ã¼ããªã¢ã«ããã£ã¦ããã¡ãã¯ç©´åãåé¡ã¨ãããã£ãã
æå¾ã«ããã¥ã¡ã³ããããã£ã¨èªãã§ã¿ããExample
ãã¨ã¦ãåèã«ãªãã®ã§ããããè¦ãªããåãããªãã¨ããã調ã¹ãã¹ã¿ã¤ã«ã§è¯ãããã
使ã£ã¦ã¿ã
ã¨ãããã sl ãèµ°ãããããã®ã¤ã¡ã¼ã¸ãä½ã£ã¦ã¿ã¦æ触ãæ´ããã¨ã«ãããä½ãæ¹ãªã©ã¯å æ°ã ã£ããå¥ã«æ¸ããã¨æããã©ãå æ°ã ã£ããã¨ã¯ãã¾ã¾ã§ãªãã
çµç±ã§ https://github.com/miyagawa/docker-plenv-vanilla ã® Dockerfile
ãèªãã§åèã«ããã
Docker ã«ã¯ github + travis.ci ã¿ãã㪠DOCKER index ã¨ãããµã¼ãã¹ããã£ã¦ãdocker push
ãã¦ä½ã£ãã¤ã¡ã¼ã¸ãå
¬éããããgithub ã®ãªãã¸ããªãç»é²ãã¦ããã¨ãåæã« Dockerfile
ãåå¾+å®è¡ãã¦ããã¦ãåé¡ãªããã®ã ãå
¬éããããããã
å
¬éããã¦ãããã®ã¯ docker pull
ã¨ããã³ãã³ãã§åå¾ãã¦ããã«å®è¡ã§ããã
ãã¾ããã« sl
ãå®è¡ãããã¨ãããã¼ãºããã£ãã®ã§ãdocker run -t sixeight/dockdr-sl
㧠sl
ãèµ°ãããã«ãã¦ãããããã¡ãã¡ pull
ããªãã¦ã run
ã®å¼æ°ã§æ¸¡ããã¤ã¡ã¼ã¸ããã¼ã«ã«ã«ãªããã°ããªã¢ã¼ãããæ¢ãã¦åã£ã¦ãã¦ãããã®ã§ä½ãèããã«ã³ãã³ããå©ãã ãã§ããã«å®è¡ã§ããããã°ããããã¨ã ã¨æãã
ã©ã使ãã
ãµã¼ãã¼ã®æ§æãä½ãããã®è©¦è¡é¯èª¤ãã¯ããã¦ã®ããã«ã¦ã§ã¢ããã¼ã«ã試ãã¨ããªããã«ä½¿ãããããããå¼ç¤¾ã§ã¯æªã ã«ãµã¼ãã¼ã®ç®¡çã¯æä½æ¥ã®è·äººè¸ã«ãªã£ã¦ããã®ã§ã¾ãã¯ãããæ¯æ£ããªãã¨ãããªãããåãè·äººã«ãããªãããã¦ããªãã®ã§éã¯é ãã
ããä¸ã¤ã®ä½¿ãæ¹ã¯ä»ååããã£ããããªä½¿ãæ¹ãèãããããã¢ããªãã²ã¨éãåãç°å¢ã®ã¤ã¡ã¼ã¸ãä½ã£ã¦ããã¦ä»äººã«æ¸¡ããããªä½¿ãæ¹ã ãsl
㯠Homebrew ã§ãæä¾ããã¦ããããç°¡åã«å
¥ãããã¨ã¯ã§ãããã©ããã£ã¨è¤éãªæ§æã®ã¢ããªã±ã¼ã·ã§ã³ã ã£ãå ´åã¯ããã試ãã¦ã¿ã¦ããã¨ã¯æ°è»½ã«è¨ããªãããããã£ãã¨ãã« Docker ã®ã¤ã¡ã¼ã¸ãä½ã£ã¦ããã°ç°¡åã«æ¸¡ããã¨ãã§ããã
- ãã¼ã¿ãã«ãªWebã¢ããªã±ã¼ã·ã§ã³
- 2014å¹´ã®ã¦ã§ãã·ã¹ãã ã¢ã¼ããã¯ã㣠- stanaka's blog
æ¥å¹´ã楽ãã¿ã§ããã
追è¨
æéã¨ã£ã¦åå¼·ããã