Dockerコマンド

F2e4745f5f04a43b08d5419315b68e3c?s=47 Hiroaki ONO
November 20, 2017

 Dockerコマンド

Dockerのコマンドを説明する用に自分の知識をまとめてみた

F2e4745f5f04a43b08d5419315b68e3c?s=128

Hiroaki ONO

November 20, 2017
Tweet

Transcript

  1. %PDLFSίϚϯυ v1.0 @hihihiroro

  2. %PDLFS࢖ͬͯ·͔͢ʁ

  3. ίϚϯυଟ͘ͳ͍Ͱ͔͢ʁ

  4. https://docs.docker.com/engine/reference/commandline/docker/#child-commands

  5. https://docs.docker.com/engine/reference/commandline/docker/#child-commands ීஈ࢖͏ίϚϯυ͸ ͜Μͳʹඞཁͳ͍ʢࢲݟʣ

  6. ͜ͷεϥΠυͷ໨త w࢖͏͜ͱͷଟ͍%PDLFSίϚϯυΛ͍֮͑ͨ wΑ͘࢖͏ίϚϯυʹߜΔ wίϚϯυʹΑΔભҠΛཧղ͢Δ wֆͰ֮͑Δ

  7. ର৅ w%PDLFSͷ͜ͱΛগ͠஌ͬͯΔ wॳݟͷਓ͸͝ΊΜͳ͍͞ w୯ޠ΍ࡉ͔͍આ໌͸ল͍͍ͯ·͢ wΦϓγϣϯʹ͍ͭͯ΋جຊઆ໌͠·ͤΜ wৄ͍͜͠ͱΛ஌Γ͚ͨΕ͹ެࣜυΩϡϝϯτ

  8. ͯͳΘ͚Ͱਤղ

  9. SNJ EFMFUFE TUPQQFE QVTI MPHT EJGG
 JOTQFDU SN QVMM TUBSU

    FYFD
 BUUBDI TUPQLJMM QBVTF QBVTFE QT CVJME VOQBVTF FYQPSU SVO DPNNJU JNQPSU TBWF JNBHFT IJTUPSZ JOTQFDU SVOOJOH UBHT MPBE IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPO EFTJHOFECZGSPN'MBUJDPO
  10. SNJ EFMFUFE TUPQQFE QVTI MPHT EJGG
 JOTQFDU SN QVMM TUBSU

    FYFD
 BUUBDI TUPQLJMM QBVTF QBVTFE QT CVJME VOQBVTF FYQPSU SVO DPNNJU JNQPSU TBWF JNBHFT IJTUPSZ JOTQFDU SVOOJOH UBHT MPBE IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPO EFTJHOFECZGSPN'MBUJDPO ίϯςφଆૢ࡞ Πϝʔδଆૢ࡞
  11. Ҏ্ɻ

  12. ͔͜͜Β͸ίϚϯυͷઆ໌

  13. Πϝʔδଆૢ࡞༻

  14. SNJ EFMFUFE TUPQQFE QVTI MPHT EJGG
 JOTQFDU SN QVMM TUBSU

    FYFD
 BUUBDI TUPQLJMM QBVTF QBVTFE QT CVJME VOQBVTF FYQPSU SVO DPNNJU JNQPSU TBWF JNBHFT IJTUPSZ JOTQFDU SVOOJOH UBHT MPBE IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPO EFTJHOFECZGSPN'MBUJDPO
  15. SNJ EFMFUFE TUPQQFE QVTI MPHT EJGG
 JOTQFDU SN QVMM TUBSU

    FYFD
 BUUBDI TUPQLJMM QBVTF QBVTFE QT CVJME VOQBVTF FYQPSU SVO DPNNJU JNQPSU TBWF JNBHFT IJTUPSZ JOTQFDU SVOOJOH UBHT MPBE IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPO EFTJHOFECZGSPN'MBUJDPO ࡞੒ ϨδετϦͱͷ
 ΍ΓͱΓ Πϝʔδૢ࡞͋Ε͜Ε Πϝʔδ®UBS
  16. Πϝʔδଆ w JNBHFTʢΠϝʔδҰཡදࣔʣ w UBHʢΠϝʔδ΁ͷλά෇͚ʣ w IJTUPSZJOTQFDUʢߋ৽಺༰ɾৄࡉ৘ใʣ w SVOʢίϯςφͷ࣮ߦʣ w

    SNJʢΠϝʔδ࡟আʣ w CVJMEʢΠϝʔδ࡞੒ʣ w TBWFMPBEʢΠϝʔδͷϑΝΠϧग़ྗɾೖྗʣ w QVMMQVTIʢΠϝʔδͷμ΢ϯϩʔυɾొ࿥ʣ
  17. Πϝʔδૢ࡞͋Ε͜Ε

  18. EPDLFSJNBHFT ΠϝʔδͷҰཡΛදࣔ

  19. EPDLFSUBH ΠϝʔδʹλάΛ෇͚Δ

  20. EPDLFSIJTUPSZJOTQFDU IJTUPSZɿΠϝʔδͷߏஙཤྺΛදࣔ JOTQFDUɿΠϝʔδʹؔ͢Δৄࡉ৘ใΛ+40/ܗࣜͰදࣔ

  21. EPDLFSSVO Πϝʔδ͔Βίϯςφͷىಈ

  22. EPDLFSSNJ Πϝʔδͷ࡟আ

  23. Πϝʔδ࡞੒

  24. EPDLFSCVJME %PDLFSpMF͔ΒΠϝʔδΛ࡞੒

  25. Πϝʔδ®ϑΝΠϧ

  26. EPDLFSTBWFMPBE TBWFɿΠϝʔδΛUBSΞʔΧΠϒʹอଘ MPBEɿUBSΞʔΧΠϒ͔45%*/͔ΒΠϝʔδΛಡΈࠐΉ TBWF MPBE

  27. ϨδετϦ͋Ε͜Ε

  28. EPDLFSQVMMQVTI QVMMɿSFHJTUSZ͔ΒΠϝʔδͷऔಘ QVTIɿSFHJTUSZ΁Πϝʔδͷొ࿥ QVMM QVTI

  29. EPDLFSQVMMQVTI QVMMɿSFHJTUSZ͔ΒΠϝʔδͷऔಘ QVTIɿSFHJTUSZ΁Πϝʔδͷొ࿥ QVMM QVTI EPDLFSMPHJO SFHJTUSZ΁ͷϩάΠϯ

  30. ίϯςφଆૢ࡞༻

  31. SNJ EFMFUFE TUPQQFE QVTI MPHT EJGG
 JOTQFDU SN QVMM TUBSU

    FYFD
 BUUBDI TUPQLJMM QBVTF QBVTFE QT CVJME VOQBVTF FYQPSU SVO DPNNJU JNQPSU TBWF JNBHFT IJTUPSZ JOTQFDU SVOOJOH UBHT MPBE IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPO EFTJHOFECZGSPN'MBUJDPO
  32. SNJ EFMFUFE TUPQQFE QVTI MPHT EJGG
 JOTQFDU SN QVMM TUBSU

    FYFD
 BUUBDI TUPQLJMM QBVTF QBVTFE QT CVJME VOQBVTF FYQPSU SVO DPNNJU JNQPSU TBWF JNBHFT IJTUPSZ JOTQFDU SVOOJOH UBHT MPBE IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPO EFTJHOFECZGSPN'MBUJDPO ఀࢭ ࡟আ Ұ࣌ఀࢭ ίϯςφૢ࡞͋Ε͜Ε ίϯςφ®UBS ίϯςφ಺෦͋Ε͜Ε
  33. ίϯςφଆ w QTʢίϯςφҰཡදࣔʣ w MPHTEJGGJOTQFDUʢΠϝʔδͷμ΢ϯϩʔυɾొ࿥ʣ w DPNNJUʢߋ৽಺༰ɾৄࡉ৘ใʣ w FYQPSUJNQPSUʢΠϝʔδͷϑΝΠϧग़ྗɾೖྗʣ w

    QBVTFVOQBVTFʢΠϝʔδ΁ͷλά෇͚ʣ w TUPQTUBSULJMMʢΠϝʔδ࡞੒ʣ w FYFDBUUBDIʢΠϝʔδ࡟আʣ w SNʢʣ
  34. ίϯςφૢ࡞͋Ε͜Ε

  35. EPDLFSQT ίϯςφͷҰཡΛදࣔ BΦϓγϣϯͰશͯͷίϯςφΛදࣔ GΦϓγϣϯͰϑΟϧλ

  36. EPDLFSMPHT ίϯςφͷϩάΛऔಘ ग़ྗ͞Εͨϩά͢΂ͯΛදࣔ ϩάͷग़ྗΛϑΥϩʔ

  37. EPDLFSEJGG ίϯςφͷϑΝΠϧγεςϜʹର͢Δมߋͷදࣔ ίϯςφ಺෦ͰUFYUUYUΛ࡞੒ $USMʴ1ˠ$USMʴ2Ͱίϯςφ͔Β୤ग़ ίϯςφ಺෦ͰEPDLFSFOWΛ࡟আ "ɿ௥Ճ %ɿ࡟আ $ɿมߋ

  38. EPDLFSJOTQFDU ίϯςφʹؔ͢Δৄࡉ৘ใΛ+40/ܗࣜͰදࣔ

  39. EPDLFSDPNNJU ίϯςφ͔Β৽͍͠Πϝʔδͷ࡞੒

  40. ίϯςφ®ϑΝΠϧ

  41. EPDLFSFYQPSUJNQPSU FYQPSUɿίϯςφͷ಺༰ΛUBSΞʔΧΠϒʹอଘ JNQPSUɿUBSΞʔΧΠϒ͔ΒۭͷΠϝʔδΛ࡞੒ FYQPSU JNQPSU

  42. ίϯςφҰ࣌ఀࢭ

  43. EPDLFSQBVTFVOQBVTF QBVTFɿίϯςφ಺ͷશͯͷϓϩηεΛҰ࣌ఀࢭ VOQBVTFɿίϯςφ಺ͷશͯͷϓϩηεͷҰ࣌ఀࢭΛղআ QBVTF VOQBVTF

  44. ίϯςφఀࢭ

  45. EPDLFSTUPQTUBSULJMM TUPQɿ࣮ߦதͷίϯςφʹ4*(5&3.Λૹ৴͠ɺҰఆظؒޙʹ4*(,*--Λૹ৴ LJMMɿ࣮ߦதͷίϯςφΛ4*(,*--͔ࢦఆͨ͠γάφϧͰఀࢭ TUBSUɿఀࢭ͍ͯ͠ΔίϯςφΛىಈ͢Δ TUPQ TUBSU LJMM

  46. ίϯςφ಺෦͋Ε͜Ε

  47. EPDLFSFYFD ࣮ߦதͷίϯςφͰ௥ՃίϚϯυΛ࣮ߦ FYFDͰ࣮ߦ

  48. EPDLFSBUUBDI ࣮ߦதͷίϯςφͰ্ཱ͕͍ͪͬͯΔ 1*%ͷϓϩηεʹରͯ͠ඪ४ೖग़ྗΛ઀ଓ͢Δ $USM DͰࢭ·Βͳ͍ $USM DͰࢭ·Δ ٙࣅλʔϛφϧͷׂ౰

  49. ίϯςφ࡟আ

  50. EPDLFSSN ίϯςφͷ࡟আ ఀࢭͨ͠ίϯςφ͸࡟আͰ͖Δ ىಈதίϯςφ͸࡟আͰ͖ͳ͍
 GΦϓγϣϯͰ࡟আͰ͖Δ

  51. SNJ EFMFUFE TUPQQFE QVTI MPHT EJGG
 JOTQFDU SN QVMM TUBSU

    FYFD
 BUUBDI TUPQLJMM QBVTF QBVTFE QT CVJME VOQBVTF FYQPSU SVO DPNNJU JNQPSU TBWF JNBHFT IJTUPSZ JOTQFDU SVOOJOH UBHT MPBE IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPO EFTJHOFECZGSPN'MBUJDPO
  52. 2JJUBʹ΋͋ΔΑ IUUQTRJJUBDPNIJIJIJSPSPJUFNT EEBEDBEB

  53. BQQFOEJY

  54. Dockerとは wίϯςφΛ഑෍ɺ࣮ߦ͢ΔͨΊͷϓϥοτϑΥʔϜ w ࣮ߦʹඞཁͳ͢΂ͯΛϑΝΠϧγεςϜԽ w %PDLFS͕ಈ͘؀ڥͳΒಈ࡞Λอূ w ϓϩηεͱ্ཱ͕ͯͪ͠ΔͷͰܰྔ

  55. コンテナ wִ཭͞Ε͍ͯΔܰྔ7.ʢ࣮ଶ͸ϓϩηεʣ w/BNF4QBDF wϚ΢ϯτɺϓϩηεɺϢʔβͳͲ໊લۭؒ͝ͱʹࣝผɾӅณ͢Δػೳ wDHSPVQ wϓϩηεʹରͯ͠$16΍ϝϞϦͳͲͷϦιʔεʹ੍ݶΛ͔͚Δ wDISPPU wϧʔτσΟϨΫτϦΛ೚ҙͷಛఆͷσΟϨΫτϦʹมߋͰ͖Δ wOFUOT wϗεταʔό಺ʹԾ૝తϒϦοδͱԾ૝/*$͔ΒͳΔԾ૝ωοτϫʔΫΛߏங

  56. レイヤ w%PDLFSΠϝʔδ͸૚ w֤ϨΠϠ͸਌ࢠؔ܎ wΠϝʔδϨΠϠ͸
 3FBE0OMZ wίϯςφ͸Πϝʔδʹ
 ৽͍͠ϨΠϠΛ௥Ճ ΠϝʔδϨΠϠ ίϯςφϨΠϠ IUUQTEPDTEPDLFSDPNFOHJOFVTFSHVJEF

    TUPSBHFESJWFSJNBHFTBOEDPOUBJOFSTDPOUBJOFS BOEMBZFST