コンテナ型仮想化入門 / Introduction to container-based virtualization

コンテナ型仮想化入門 / Introduction to container-based virtualization

D984cd543d2abef28596cc5cfe82240c?s=128

Yusuke Miyazaki

May 16, 2016
Tweet

Transcript

  1. Introduction to container-based virtualization ޒेཛྷɾ຤Ӭݚڀࣨன৯ձ :VTVLF.JZB[BLJ !૯߹ݚڀ߸ؗ ίϯςφܕԾ૝Խೖ໳

  2. ໨࣍ w ैདྷͷԾ૝ϚγϯʹΑΔԾ૝Խ w ίϯςφܕԾ૝Խͱ͸ w ίϯςφܕԾ૝ԽΛ࣮ݱ͢Δٕज़ w %PDLFSͱ͸ w

    σϞ
  3. ෺ཧϚγϯ ϋʔυ΢ΣΞ ΦϖϨʔςΟϯάγεςϜ ΞϓϦέʔγϣϯ ΞϓϦέʔγϣϯ

  4. Ծ૝Ϛγϯ 7. w ϗετ04ͷ্Ͱผͷήετ04Λಈ࡞ͤ͞Δٕज़ w ήετ04Λಈ࡞ͤ͞ΔͨΊʹϋʔυ΢ΣΞΛ ΤϛϡϨʔτ w ϋΠύʔόΠβͰ7.Λ؅ཧ

  5. Ծ૝Ϛγϯ ϋʔυ΢ΣΞ ΦϖϨʔςΟϯάγεςϜ ΞϓϦ ϋΠύʔόΠβ 04 04 ΞϓϦ

  6. Ծ૝ԽͷϝϦοτ w ෳ਺ͷ෺ཧαʔόʔΛ౷߹ w 8JOEPXTPO-JOVY΋Մೳ w ؅ཧ͕༰қʹ ϚγϯΛϑΝΠϧͱͯ͠ѻ͑Δ

  7. Ծ૝ԽͷσϝϦοτ w Ծ૝ԽʹΑΔΦʔόʔϔου ಛʹ*0  w Ծ૝ԽʹΑΓϚγϯ͕૿͑Δ͜ͱ͕͋Γ 
 ͦͷ৔߹ͷߏ੒؅ཧ

  8. Ծ૝Ϛγϯ ϋʔυ΢ΣΞ ΦϖϨʔςΟϯάγεςϜ ΞϓϦ ϋΠύʔόΠβ 04 04 ΞϓϦ ^༷ʑͳ޻෉Ͱ ߴ଎Խ

    ྫ75Y ,FSOFM NPEVMFT
  9. ίϯςφܕԾ૝Խ w ΞϓϦέʔγϣϯΛϗετ04্ͷϓϩηεͱ͠ ࣮ͯߦ w 04ͷΧʔωϧͷػೳΛ࢖ͬͯ 
 ༷ʑͳϦιʔεΛ֤ίϯςφ͝ͱʹִ཭

  10. ίϯςφ ίϯςφܕԾ૝Խ ϋʔυ΢ΣΞ ΦϖϨʔςΟϯάγεςϜ ΞϓϦέʔγϣϯ ίϯςφ ΞϓϦέʔγϣϯ

  11. ίϯςφܕԾ૝ԽͷϝϦοτ w Ϧιʔεͷফඅྔ͕গͳ͍ w ଟ͘ͷίϯςφΛҰͭͷϚγϯͰ w ΞϓϦέʔγϣϯͷΈͷىಈ w Φʔόʔϔου͕গͳ͍ w

    ىಈ͕ૣ͍
  12. ίϯςφܕԾ૝ԽͷσϝϦοτ w ΧʔωϧΛϗετͱڞ༗͢Δ w %FCJBO্Ͱ$FOU04Λಈ͔ͯ͠΋ Χʔωϧ ͸%FCJBOͷ΋ͷ w 7.ͰՄೳͳ8JOEPXTPO-JOVY͸ෆՄ

  13. Ϧιʔεͷִ཭ w ֤ίϯςφؒͷϦιʔεͷִ཭ʹ͸Χʔωϧͷ ػೳΛ༻͍Δ w ੲ͔Β͋ΔDISPPUͷߟ͑ํΛ༷ʑͳϦιʔε ʹ͍֦ͭͯுͨ͠Πϝʔδ w Ҏ߱͸-JOVYʹ͍ͭͯͷ͓࿩

  14. Ϧιʔεͷִ཭ w -JOVY w OBNFTQBDF NPVOU 1*% 6*% (*% FUDʜ

     w DHSPVQT $16 NFNPSZ FUDʜ  w ͳͲ
  15. BVGT w BEWBODFENVMUJMBZFSFEVOJpDBUJPO pMFTZTUFN w ϨΠϠʔঢ়ʹͳͬͨ ϑΝΠϧγεςϜ w -JOVYͷ-JWF$%%7%ͳͲͰ࠾༻͞Ε͖ͯͨ w

    $%%7%ͷϨΠϠʔͷ্ʹϝϞϦͷ
 ϨΠϠʔ
  16. % BVGT " & # % $ " $ %`

    & -BZFS -BZFS -BZFS ্͔ΒݟΔͱ &` # %` &`
  17. %PDLFS w Ұ൪ྲྀߦͬͯΔίϯςφܕԾ૝Խٕज़ w -JOVYͷίϯςφٕज़ w ಛघͳϑΝΠϧγεςϜ BVGT CUSGTͳͲ 

    w %PDLFSpMFʹΑΔΠϝʔδͷ࡞੒ w 8JOEPXT΍049Ͱར༻͢Δʹ͸ 
 ܰྔͳ-JOVYͷ7.ΛཱͯΔ
  18. %PDLFSͰͷ࡞ۀͷྲྀΕ %PDLFSpMF ΠϝʔδΛ ࡞੒͢Δͨ ΊͷϨγϐ $ docker build %PDLFSpMFΛ
 ΋ͱʹΠϝʔδΛ࡞੒

    Πϝʔδ ΞϓϦ΍
 ϑΝΠϧ
 BVGTͳͲ
  19. %PDLFSpMF FROM debian:jessie RUN apt-get install python3 COPY . /app

    EXPOSE 80 CMD ["python", "/app/start.py"]
  20. %PDLFSpMFͱBVGTͷରԠ " & # % &` " % & COPY

    . /app RUN apt-get install python3 ্͔ΒݟΔͱ # &`
  21. %PDLFSͰͷ࡞ۀͷྲྀΕ Πϝʔδ ΞϓϦ΍
 ϑΝΠϧ
 BVGTͳͲ $ docker pull / push

    ΠϝʔδΛϨδετϦ FH%PDLFS)VC ͔Βऔಘ ϨδετϦʹొ࿥ Πϝʔδͷ࠶ར༻ %PDLFSpMF ΠϝʔδΛ ࡞੒͢Δͨ ΊͷϨγϐ
  22. %PDLFSͰͷ࡞ۀͷྲྀΕ %PDLFSpMF ΠϝʔδΛ ࡞੒͢Δͨ ΊͷϨγϐ $ docker run ΠϝʔδΛ΋ͱʹίϯςφΛ ࡞੒͠ϓϩηεΛىಈ

    Πϝʔδ ΞϓϦ΍
 ϑΝΠϧ
 BVGTͳͲ "1 "1 "1
  23. ίϯςφͷ࡞੒ͱBVGT " & # % &` " % &` ্͔ΒݟΔͱ

    $ ίϯςφ͝ͱʹ ࡞੒ $ COPY . /app RUN apt-get install python3 #