Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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

Yusuke Miyazaki

May 16, 2016
Tweet

More Decks by Yusuke Miyazaki

Other Decks in Technology

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  4. Ծ૝Ϛγϯ 7.

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  7. Ծ૝ԽͷσϝϦοτ
    w Ծ૝ԽʹΑΔΦʔόʔϔου ಛʹ*0

    w Ծ૝ԽʹΑΓϚγϯ͕૿͑Δ͜ͱ͕͋Γ 

    ͦͷ৔߹ͷߏ੒؅ཧ

    View full-size slide

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

    View full-size slide

  9. ίϯςφܕԾ૝Խ
    w ΞϓϦέʔγϣϯΛϗετ04্ͷϓϩηεͱ͠
    ࣮ͯߦ
    w 04ͷΧʔωϧͷػೳΛ࢖ͬͯ 

    ༷ʑͳϦιʔεΛ֤ίϯςφ͝ͱʹִ཭

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    w DHSPVQT $16 NFNPSZ FUDʜ

    w ͳͲ

    View full-size slide

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

    ϨΠϠʔ

    View full-size slide

  16. %
    BVGT
    " &
    # %
    $
    " $ %` &
    -BZFS
    -BZFS
    -BZFS
    ্͔ΒݟΔͱ
    &`
    #
    %`
    &`

    View full-size slide

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

    w %PDLFSpMFʹΑΔΠϝʔδͷ࡞੒
    w 8JOEPXT΍049Ͱར༻͢Δʹ͸ 

    ܰྔͳ-JOVYͷ7.ΛཱͯΔ

    View full-size slide

  18. %PDLFSͰͷ࡞ۀͷྲྀΕ
    %PDLFSpMF
    ΠϝʔδΛ
    ࡞੒͢Δͨ
    ΊͷϨγϐ
    $ docker build
    %PDLFSpMFΛ

    ΋ͱʹΠϝʔδΛ࡞੒
    Πϝʔδ
    ΞϓϦ΍

    ϑΝΠϧ

    BVGTͳͲ

    View full-size slide

  19. %PDLFSpMF
    FROM debian:jessie
    RUN apt-get install python3
    COPY . /app
    EXPOSE 80
    CMD ["python", "/app/start.py"]

    View full-size slide

  20. %PDLFSpMFͱBVGTͷରԠ
    " &
    # % &`
    " % &
    COPY . /app
    RUN apt-get
    install
    python3
    ্͔ΒݟΔͱ # &`

    View full-size slide

  21. %PDLFSͰͷ࡞ۀͷྲྀΕ
    Πϝʔδ
    ΞϓϦ΍

    ϑΝΠϧ

    BVGTͳͲ

    $ docker pull / push
    ΠϝʔδΛϨδετϦ FH%PDLFS)VC
    ͔Βऔಘ
    ϨδετϦʹొ࿥ Πϝʔδͷ࠶ར༻

    %PDLFSpMF
    ΠϝʔδΛ
    ࡞੒͢Δͨ
    ΊͷϨγϐ

    View full-size slide

  22. %PDLFSͰͷ࡞ۀͷྲྀΕ
    %PDLFSpMF
    ΠϝʔδΛ
    ࡞੒͢Δͨ
    ΊͷϨγϐ
    $ docker run
    ΠϝʔδΛ΋ͱʹίϯςφΛ
    ࡞੒͠ϓϩηεΛىಈ
    Πϝʔδ
    ΞϓϦ΍

    ϑΝΠϧ

    BVGTͳͲ

    "1
    "1
    "1

    View full-size slide

  23. ίϯςφͷ࡞੒ͱBVGT
    " &
    # % &`
    " % &`
    ্͔ΒݟΔͱ
    $
    ίϯςφ͝ͱʹ
    ࡞੒
    $
    COPY . /app
    RUN apt-get
    install
    python3
    #

    View full-size slide