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

ソフトウェア工学06 コンテナ仮想化

ソフトウェア工学06 コンテナ仮想化

コンテナ仮想化

仮想マシン,Docker,イメージの取得とビルド,コンテナの起動,コンテナ内での開発

99b434b001cd93fe73322f764d73372c?s=128

Toru Tamaki

August 05, 2021
Tweet

Transcript

  1. ιϑτ΢ΣΞ޻ֶ nίϯςφԾ૝Խ • Ծ૝ϚγϯɼDockerɼΠϝʔδͷऔಘͱϏϧυɼίϯςφ ͷىಈɼίϯςφ಺Ͱͷ։ൃ ۄ໦పʢ໊޻େʣ

  2. Ծ૝Խ

  3. Ծ૝Խͱ͸ nܭࢉػ؀ڥΛந৅Խ͢Δ͜ͱ • Ծ૝తͳϋʔυ΢ΣΞΛιϑτ΢ΣΞͱͯ͠༻ҙ͢Δ • CPUɼϝϞϦɼάϥϑΟοΫεɼωοτϫʔΫɼHDD • ͦͷԾ૝ϋʔυ΢ΣΞ্ʹԾ૝OS͕ಈ͘ • άϥϑΟΫε΋Ծ૝Խ͞ΕΔͱGUI͕ಈ࡞

    nԾ૝Խ͞ΕͨϚγϯ • Ծ૝ϚγϯʢVMɼVirtual Machineʣ • IaaSͰར༻ n༻ޠ • ϗετOSɿVMΛಈ࡞ͤ͞ΔOS • ήετOSɿVMதͷOS ϋʔυ΢ΣΞ OS ΞϓϦ ϋʔυ΢ΣΞ ϗετOS Ծ૝Խιϑτ ήετ OS ΞϓϦ ήετ OS ΞϓϦ ௨ৗ Ծ૝Խ
  4. Ծ૝Խ nϗετܕԾ૝Խ • ϗετOS্ͷΞϓϦ • ήετOSΛಈ͔͢ • ஗͍ nϋΠύʔόΠβʔ •

    ϗετͷϋʔυ΢ΣΞΛʢϗε τOSΛඈ͹ͯ͠ʣ௚઀ར༻͢Δ • ߴ଎ nࢀߟ • Ծ૝Խೖ໳ʢϋΠύʔόΠ βʔʣ at Qiita ϋʔυ΢ΣΞ ϗετOS Ծ૝Խιϑτ ήετ OS ΞϓϦ ήετ OS ΞϓϦ Ծ૝Խ ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ ήετ OS ΞϓϦ ήετ OS ΞϓϦ Ծ૝Խ
  5. Ծ૝Խ nྨࣅٕज़ • CPUΤϛϡϨʔλ • ҟͳΔCPU༻ͷόΠφϦ͕࣮ߦͰ͖Δ • Intel (x86, x86-64/x64),

    AMD (AMD64), ARM • ϋʔυ΢ΣΞ͸Ծ૝Խ͍ͯ͠ͳ͍ • Java VM • JavaίʔυΛ࣮ߦͰ͖Δ • ϋʔυ΢ΣΞ͸Ծ૝Խ͍ͯ͠ͳ͍
  6. Ծ૝Խͷྫ ϗετOS ʢmacOSʣ ήετOS ʢUbuntuʣ ήετΞϓϦ Ծ૝Խιϑτ ʢVituralBoxʣ ϗετɾήετؒͷڞ༗ ϗετΞϓϦ

    • ڞ༗ϑΥϧμ • Ϛ΢εɾΩʔϘʔυ • USBσόΠε • ΫϦοϓϘʔυ
  7. Ծ૝Խ͞Εͨϋʔυ΢ΣΞ Ծ૝ϋʔυ΢ΣΞ

  8. Ծ૝Խͷར఺ nֶੜ • ࣗ෼ͷwindows PC্ͰLinuxΛಈ͔ͯ͠՝୊Λ࣮ߦͰ͖Δ • OSͷΠϯετʔϧͱ؅ཧΛܦݧͰ͖Δ n։ൃऀ • ӡ༻؀ڥͰͷಈ࡞ΛVMͰ֬ೝͰ͖Δ

    • ήετ؀ڥΛִ཭ͯ͠ςετͰ͖Δ nSE • ܭࢉػࢿݯΛ༗ޮ׆༻Ͱ͖Δ • 1୆ͷ෺ཧαʔόͰෳ਺ͷVMΛىಈͰ͖Δ • αʔόͷϦϓϨʔε͕༰қ • VMͷߏஙͱഁغ͕खܰʹߦ͑Δ
  9. ༨ஊɿσϡΞϧϒʔτ n1ͭͷPC͔Βෳ਺ͷOSΛىಈ • HDDΛ2ͭͷOSʹ෼ׂ • PCͷىಈ࣌ʹɼͲͷOSΛىಈ͢Δ͔ બ୒ • ͦͷOSʹׂΓ౰ͯΒΕͨHDDͰ࣮ߦ •

    ϝϦοτ • 1୆Ͱෳ਺OSΛىಈͰ͖Δ • σϝϦοτ • ಉ࣌ʹ1ͭͷOS͔࣮͠ߦͰ͖ͳ͍ • macOSͷϒʔτΩϟϯϓ • macͱwindowsͷσϡΞϧϒʔτ • ྨࣅɿUbuntuͷLive DVD/USB • DVD/USB͔ΒUbuntuΛϒʔτ HDD Public Domain CC0 ىಈը໘ Linux or Windows ? Grub 2.02 beta2-9 ubuntu1 menu DualBoot Ubuntu and WindowsTiloWiki - Own work CC BY-SA 4.0
  10. σεΫτοϓ༻Ծ૝Խιϑτ΢ΣΞ https://www.virtualbox.org https://www.vmware.com https://www.parallels.com/jp/ https://www.qemu.org ϒϥ΢βܕɿv86 https://copy.sh/v86/ https://github.com/copy/v86 JavaScriptͳͷͰϒϥ΢β্Ͱ Windows95΍Windows3.1͕ಈ͘ʂ

  11. Ϋϥ΢υαʔϏεͷԾ૝Ϛγϯ https://aws.amazon.com/jp/getting-started/launch-a-virtual-machine-B-0/ https://aws.amazon.com/jp/getting-started/hands-on/launch-windows-vm/

  12. ίϯςφԾ૝Խ n Ծ૝ԽͷσϝϦοτ • ϋʔυ΢ΣΞ΋ؚΊͯԾ૝Խ͢ΔͨΊಈ࡞͕ॏ͍ n ཧ૝ • ΞϓϦ͕ಈ࡞͢Δ࠷௿ݶͷԾ૝Խ͚ͩͰΑ͍ •

    GUI΋ෆཁ • OSϨϕϧͷԾ૝ԽͰΑ͍ • ϓϩηεΛσϓϩΠ͍ͨ͠ n ίϯςφԾ૝Խ • ຊ൪؀ڥʹσϓϩΠ͢Δ͚ͩͷ࠷খݶͷઃఆʢʹίϯςφʣ͚ͩͰΑ͍ • ΢Οϯυ΢ϚωʔδϟʢGUIʣ͸ෆཁ • PaaSͰར༻ n Docker • ίϯςφΤϯδϯͷσϑΝΫτɾελϯμʔυ
  13. 7.ͱίϯςφԾ૝Խͷҧ͍ ϋʔυ΢ΣΞ ΠϯϑϥετϥΫνϟ ϗετOS Ծ૝Խιϑτ ήετ OS ΞϓϦ ήετ OS

    ΞϓϦ VM ϋʔυ΢ΣΞ ΠϯϑϥετϥΫνϟ ϗετOS ίϯςφΤϯδϯ ίϯς φ ΞϓϦ ίϯς φ ΞϓϦ ίϯςφԾ૝Խ ೚ҙͷOSͷ ϑϧηοτ Ծ૝ϋʔυ ΢ΣΞΛ࣋ͭ LinuxͷΈ ඞཁͳόΠφϦͷΈ ϋʔυ΢ΣΞ͸ ϗετΛར༻
  14. ཁૉ Arquitetura DockerDaniloBarros - Own work CC BY-SA 4.0 nίϯςφΤϯδϯ

    • ίϯςφΛ࣮ߦ͢Διϑτ • docker nΠϝʔδ • ىಈ͢Δ࣮ߦ؀ڥͷεφοϓγϣοτ • ͭ·ΓϑΝΠϧҰ͕ࣜೖ͍ͬͯΔ • ެࣜϦϙδτϦɿDocker Hub • ଟ਺ͷΠϝʔδ͕ར༻Ͱ͖Δ • ެࣜҎ֎ʹ΋ϦϙδτϦ͸͋ΔʢMicrosoftɼNVIDIAɼQuary.ioͳͲʣ nίϯςφ • Πϝʔδ͔Βىಈ͞Ε࣮ͨߦதͷԾ૝ϓϩηε • 1ͭͷΠϝʔδ͔Βෳ਺ͷίϯςφΛىಈ͢Δ͜ͱ΋Ͱ͖Δ
  15. nϝϦοτ • ࢿݯ͕ޮ཰తʹར༻Ͱ͖Δ • ؀ڥߏங͕༰қʢΠϯϑϥߏஙͷࣗಈԽʣ • σϓϩΠ͕༰қʢίϯςφ͚ͩ͋Ε͹Α͍ʣ nVMͱൺֱͨ͠ϝϦοτ • ෳ਺ͷVMɿෳ਺ͷϋʔυ΢ΣΞΛԾ૝Խ

    • ෳ਺ͷίϯςφɿϋʔυ΢ΣΞԾ૝Խ͸ෆཁ • ίϯςφ͚ͩσϓϩΠ͢Ε͹Α͍
  16. ίϯςφΦʔέετϨʔγϣϯ nෳ਺ͷίϯςφʹΑΔΫϥελ • ͦͷͨΊͷ౷߹؅ཧπʔϧ • Kubernetes (k8s) ͕༗໊ʢݱࡏͷσϑΝΫτʣ • ͪΐͬͱෑډ͕ߴ͍

    • docker-compose͕؆୯ʁdockerʹ෇ଐ • ࣍ճҎ߱Ͱ͸docker-composeΛ࢖͍·͢
  17. %PDLFSͷઃఆ ஫ҙɿ !"#$%&ͷ։ൃ͸଎͍ͷͰɼ͜ΕҎ߱ͷઆ໌͕ݹ͘ͳ͍ͬͯΔ৔߹΋͋Γ·͢ɽͦͷ৔߹ʹ͸֤ࣗͰ࠷৽ͷ৘ใʹಡΈସ͍͑ͯͩ͘͞ɽ ྫɿ • Ҏલ͸ʮ!"#$%&'(%)$*"+ʯͱ͍͏໊শͰ͸ͳ͔ͬͨ • Ҏલ͸μογϡϘʔυ͸ͳ͔ͬͨ • ("#$%&,#"-+")%͸("#$%&ʹ౷߹͞ΕΔ

  18. μ΢ϯϩʔυ https://www.docker.com ެࣜαΠτͷ Get startedʹߦ͘

  19. μ΢ϯϩʔυ Desktop൛Λ μ΢ϯϩʔυ͢Δ

  20. Πϯετʔϧखॱ n !"#$% • !""#$%&&'()$*'()+,-*.#&'()+,-/0(-/ 12)&34$"255*!"15 • 67νοϓ౥ࡌͰ΋89ʢͨͩ͠ :($,""2;<͕ඞཁʣ •

    !""#$%&&=3=2>34,*4,"&4,?$&<@<7@A7 B/'()+,-/17/12)& n &'()*+,-./-01*2-3)4#"5'*(2- 3(56171',6 • !""#$%&&'()$*'()+,-*.#&'()+,-/0(-/ ?34'(?$&34$"255*!"15 n &'()*+,-./-8*!6 • !""#$%&&'()$*'()+,-*.#&'()+,-/0(-/ ?34'(?$&34$"255/?34'(?$/!(1,*!"15 • ͨͩ͠'()+,-ͷલʹɼCDE<ͷઃఆ͕ ઌʹඞཁ • !""#$%&&'()$*13)-($(0"*)(1&.2/ .#&?34'(?$&?$5&34$"255/?347@ • ʮखಈΠϯετʔϧͷखॱʯͷ खॱ7ʙFΛ࣮ߦ͢Δ • ʢΦϓγϣϯʣखॱBͰ͸ GHI4"I<@*@AEJDΛೖΕΔ • ʢΦϓγϣϯʣC34'(?$λʔϛ φϧ΋ೖΕΔ • όʔδϣϯΛCDE<ʹઃఆ͢Δ 2021೥4݄࣌఺ͷ৘ใ
  21. '"2 nQɿDocker for WindowsͰҎԼͷ Τϥʔ͕ग़࣮ͯߦͰ͖·ͤΜ • error during connect: This

    error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine /v1.24/images/create?fromImage=gcc&tag=l atest": open //./pipe/docker_engine: The system cannot find the file specified. nAɿPCͷ࠶ىಈ΍ɼdockerͷ restartɼdockerͷ࠶Πϯετʔϧ ͳͲΛࢼͯ͠Έ͍ͯͩ͘͞ɽ n·ͨҎԼͷ৘ใΛࢀߟʹͯ͠ݟͯ ͍ͩ͘͞ɽ https://tonaise.hatenablog.jp/entry/2021/02/02/070000 https://note.com/kiwikiwi_1959/n/n5d8b0a710dcd https://file-translate.com/ja/blog/docker-can-not-start-on- windows https://wp.kobore.net/ߐ୺͞Μͷٕज़ϝϞ/post-2438/ https://blog.saboh.net/dockerforwindows/ https://ginpen.com/2020/11/24/wsl-2-cannot-connect-to-the- docker-daemon/ https://wisteriahill.sakura.ne.jp/CMS/WordPress/2020/09/07/ docker-desktop-for-windows-trial/ https://docs.docker.jp/config/daemon/daemon.html
  22. '"2 n QɿdockerͷϝϞϦ࢖༻ྔ͕ଟ͍ ͷͰগͳ͍ͨ͘͠ n AɿDocker for Windowsͷ৔߹ɼҎ ԼͷϖʔδΛࢀߟʹWSLͷϝϞϦ ্ݶΛઃఆͯ͠Έ͍ͯͩ͘͞ɽ

    • https://docs.microsoft.com/en-us/windows/wsl/wsl- config#configure-global-options-with-wslconfig n Docker for Macͷ৔߹ɼDocker DesktopͷPreference -> Resources -> AdvancedʹߦͬͯɼCPUɾ࢖༻ ϝϞϦɾSwapͳͲΛઃఆͯ͠Έͯ ͍ͩ͘͞ɽ
  23. ஫ҙɿඞͣ04Λ࠷৽ʹ͓ͯ͘͜͠ͱ n࠷৽OSΛԾఆ͍ͯ͠Δ͜ͱ͕ଟ͍ • Ξοϓσʔτ͍ͯ͠ͳ͍ͱ • ΠϯετʔϧͰ͖ͳ͍ • ಈ࡞͠ͳ͍ • ಈ࡞͕ෆ҆ఆ

    • ͔΋͠Εͳ͍ͷͰ஫ҙʂ macOSͷ৔߹ Windows10ͷ৔߹
  24. Πϯετʔϧˍ࣮ߦ Windows 10 Home & Pro macOS

  25. μογϡϘʔυ μ΢ϯϩʔυͯ͋͠ΔΠϝʔδ ʢ͜ͷը໘Ͱ͸Πϝʔδ͸ͳ͍ʣ

  26. ࣮ߦதͷίϯςφ ʢ͜ͷը໘Ͱ͸࣮ߦதͷίϯςφ͸ͳ͍ʣ

  27. ίϚϯυϥΠϯ༻ͷλʔϛφϧ n!"#$% • ඪ४ͷλʔϛφϧ • ͓͢͢Ίɽ • !"#$%& • ͓͢͢Ίɽಁ໌ʹͰ͖Δ

    n&'()*+, • ίϚϯυϓϩϯϓτ • ੲ͔Β͋Δɽ࢖͍ʹ͍͘ɽίϐ ϖ΋ΊΜͲ͍͘͞ • '()#$*+#,,-.-/!01()2-'()#$*+#,, • ࠷ۙͷ)!0༻ɽ·ͩ·͠ • /!01()2λʔϛφϧ • +33425..1(627%!6$(2(8376(%.9:; 94.)!01()2.3#$%!0:,.<#3;23:$3#1 • ࢖͍΍͍͢ɽ͓͢͢Ίɽίϐϖ ΋ָɽ • ίϚϯυϓϩϯϓτ΋ '()#$*+#,,΋/*=&΋બ΂Δ https://iterm2.com ͜ͷεϥΠυͰ࢖༻ ͢Δ؀ڥม਺΋࢖͑ ͳ͍ͷͰɼ࢖Θͳ͍ Ͱ͍ͩ͘͞ Ҏ߱winͰ͸ɼ Windowsλʔϛφϧ ͰPowerShellΛར༻ ͢Δ͜ͱΛલఏʹ͠ ·͢
  28. %PDLFSίϚϯυ ndocker͸ίϚϯυϥΠϯͰ࣮ߦ͢Δ • μογϡϘʔυͳΒGUIͰ؆୯ͳૢ࡞ͳΒՄೳ nجຊίϚϯυ • docker pull • Docker

    Hub͔ΒΠϝʔδΛμ΢ϯϩʔυ • docker run • Πϝʔδ͔ΒίϯςφΛىಈ
  29. %PDLFSίϚϯυ https://www.flickr.com/photos/appleboy/25622175940 Bo-Yi Wu, Docker-cheat-sheet-by-RebelLabs, CC BY 2.0

  30. Πϝʔδͷμ΢ϯϩʔυ ΠϝʔδͷϦετΛදࣔ͢ΔίϚϯυ Πϝʔδ໊ λά • όʔδϣϯͳͲ • latestͳΒ࠷৽όʔδϣϯ Πϝʔδͷ ϋογϡ஋

    Πϝʔδͷ༰ྔ ͍ͭΠϝʔδ͕࡞੒͞Εͨͷ͔
  31. Πϝʔδͷμ΢ϯϩʔυ ΠϝʔδΛDocker Hub ͔Βμ΢ϯϩʔυ͢Δ ίϚϯυ μ΢ϯϩʔυ͢ΔΠϝʔδΛ ʮΠϝʔδ໊:λάʯͰࢦఆ https://hub.docker.com/layers/python/library/python/3.7.10- slim/images/sha256- 482d4cc1ae3c95d0f4dd25005e22a17f22f693ca7fb07bb7870f

    f9354844f738?context=explore ͜͜Ͱμ΢ϯϩʔυ͍ͯ͠ΔΠϝʔδͷURL
  32. Πϝʔδͷμ΢ϯϩʔυ ΠϝʔδͷϦετΛදࣔ͢ΔίϚϯυ ࠶౓ΠϝʔδͷϦετΛΈΔͱ μ΢ϯϩʔυ͞Ε͍ͯΔ͜ͱ͕Θ͔Δ

  33. ίϯςφͷىಈ ίϯςφͷϦετΛදࣔ͢ΔίϚϯυ docker container ls ͸ docker ps ͱಉ͡

  34. ίϯςφͷىಈ ίϯςφΛىಈ ͢ΔίϚϯυ ϗετͷ ίϚϯυϥΠϯ ίϯςφͰ ࣮ߦதͷbash ίϯςφͱͯ͠ىಈ ͢ΔΠϝʔδ໊ ίϯςφ಺Ͱ࣮ߦ

    ͢ΔίϚϯυ໊ Φϓγϣϯɿί ϯςφऴྃ࣌ʹ ίϯςφΛ࡟আ Φϓγϣϯɿ ඪ४ೖྗΛ઀ଓ
  35. ίϯςφͷىಈ ϗετ masOS ίϯςφ Linux (debian) ίϯςφΛൈ͚Δʹ͸ Ctl+DͰbashΛऴྃ͢Δ

  36. ίϯςφ͸شൃੑ nشൃੑ • ίϯςφ಺ͷ࡞ۀ͸ίϯςφऴྃ ͱͱ΋ʹফ͑Δ n։ൃ࣌ͷ஫ҙ • ίϯςφ಺ͰίʔσΟϯάɼमਖ਼ɼ ࣮ߦΛͯ͠΋ɼ݁Ռ͸࢒Βͳ͍ nղܾࡦ

    • ίϯςφ͔ΒϗετΛϚ΢ϯτ͢ Δ • Ϛ΢ϯτ • ଞͷσόΠεͷϑΝΠϧγες ϜΛࣗ෼ͷϑΝΠϧγεςϜͱ ಉ༷ʹར༻Ͱ͖ΔΑ͏ʹ͢Δ͜ ͱ nίʔσΟϯά͸ίϯςφ֎Ͱ • ϗετଆͰίʔσΟϯάɼमਖ਼ • ࣮ߦ͸ίϯςφͰߦ͏
  37. ϗετΛϚ΢ϯτ͢Δ ϗετ ίϯςφ ϗετͷσΟϨΫτϦΛίϯςφ ʹϚ΢ϯτ͢ΔίϚϯυ ϗετͷݱࡏͷ ࡞ۀσΟϨΫτϦ ίϯςφͰͷϚ΢ϯτઌ ϗετʹ͋Δ ϑΝΠϧ

    Ϛ΢ϯτઌ ΁Ҡಈ͢Δͱ ϗετͷϑΝΠ ϧ͕ݟ͍͑ͯΔ
  38. ίϯςφ಺ͰΠϯλϥΫςΟϒʹ࣮ߦ ࣮ߦ͍ͨ͠ ϗετ্ͷ PythonεΫϦϓτ ίϯςφ಺ͷPythonͰ࣮ߦ numpyϞδϡʔϧ͕ ͳ͍ͷͰΤϥʔ ͜ͷ΍Γํͷ໰୊఺ • ΠϯλϥΫςΟϒʹ͔࣮͠ߦͰ͖͍ͯͳ͍

    • ඞཁͳϞδϡʔϧΛख࡞ۀͰΠϯετʔϧ͠ͳ͚Ε͹ͳΒͳ͍
  39. %PDLFSΠϝʔδͷϏϧυ

  40. ಠࣗΠϝʔδͷϏϧυ ndockerfile • build༻ͷઃఆϑΝΠϧ ndocker build • طଘΠϝʔδΛݩʹ৽ͨͳΠϝʔδΛϏϧυ FROMɿݩʹ͢ΔΠϝʔδ໊ RUNɿΠϝʔδ࡞੒࣌ʹ࣮ߦ͢ΔίϚϯυ

    WORKDIRɿίϯςφ಺ͷ࡞ۀσΟϨΫτϦͷࢦఆ ৄࡉ͸dockerfileϦϑΝϨϯεΛࢀর
  41. ಠࣗΠϝʔδͷϏϧυ ndockerfile • build༻ͷઃఆϑΝΠϧ ndocker build • طଘΠϝʔδΛݩʹ৽ͨͳΠϝʔδΛϏϧυ ΠϝʔδΛϏϧ υ͢ΔίϚϯυ

    -tͰΠϝʔδ໊Λઃఆ • Πϝʔδ໊ • ͜͜Ͱ͸”mypython”ʹͨ͠ • ίϩϯҎ߱ʹλάΛࢦఆͰ͖Δ • ͜͜Ͱ͸”0.1”ʹͨ͠ ࠷ޙʹdockerfile͕͋Δ σΟϨΫτϦΛࢦఆ ৄࡉ͸dockerfileϦϑΝϨϯεΛࢀর
  42. ಠࣗΠϝʔδͷϏϧυ ndockerfile • build༻ͷઃఆϑΝΠϧ ndocker build • طଘΠϝʔδΛݩʹ৽ͨͳΠϝʔδΛϏϧυ

  43. ಠࣗΠϝʔδͰ࣮ߦ ϗετ ίϯςφ ֬ೝͷͨΊ bashΛ࣮ߦ ϗετ ίϯςφͷCWD͸/mntʹͳ͍ͬͯΔ ʢDockerfileͷWORKDIRͰࢦఆ͔ͨ͠Βʣ ίϯςφ಺ͷpythonΛ ϗετ͔Β࣮ߦ

    ίϯςφ಺Ͱ ࣮ߦ͞ΕΔίϚϯυ ʢҾ਺·ͰؚΊͯʣ ίϯςφ಺ͷ࣮ߦ݁Ռ͸ ϗετʹදࣔ͞ΕΔ Πϝʔδ໊:λά
  44. ิ଍ɿΠϝʔδͷCVJMEͰࣦഊ͢Δ৔߹ ndocker build΍docker-compose buildͰࣦഊ͢Δ৔߹ʹ͸ɼҎԼΛࢼ ͍ͯͩ͘͠͞ • dockerΛ࠶ىಈ͢Δ • ϩʔΧϧPCΛ࠶ىಈ͢Δ nࢀߟɿWSLͰapt

    install error “Release file is not valid yet. Updates for this repository will not be applied.” n
  45. ࣮ࡍʹ΍ͬͯΈΔ

  46. ԋशɿHDD nCݴޠͷαϯϓϧϓϩάϥϜmain.cΛ༻ҙ͢Δ nCίϯύΠϥgccͷΠϝʔδΛpull ndockerfileΛ࡞੒ nίϯςφ಺ͷgccͰɼϗετͷϑΝΠϧmain.cΛίϯύΠϧ • ੜ੒͞ΕΔ࣮ߦόΠφϦa.out͸ϗετଆʹอଘ nίϯςφ಺ͰɼϗετͷϑΝΠϧa.outΛ࣮ߦ ͜ͷԋश༻ͷzipϑΝΠϧΛμ΢ϯϩʔυ͍ͯͩ͘͠͞

  47. https://hub.docker.com ͰΠϝʔδΛݕࡧ

  48. ஫ҙɿ1.5GB͙Β͍͋Γ·͢

  49. None
  50. ద౰ͳαϯϓϧϓϩάϥϜ gccΠϝʔδΛ΋ͱʹ৽͍͠ΠϝʔδΛϏϧυ

  51. None
  52. ίϯςφ಺Ͱ ࣮ߦ͞ΕΔίϚϯυ ʢҾ਺·ͰؚΊͯʣ

  53. ԋशɿ+BWB nJavaͷαϯϓϧϓϩάϥϜMain.javaΛ༻ҙ͢Δ nJavaίϯύΠϥͷΠϝʔδΛpull ndockerfileΛ࡞੒ nίϯςφ಺ͷJavaͰɼϗετͷϑΝΠϧMain.javaΛίϯύΠϧ • ੜ੒͞ΕΔJavaόΠφϦ͸ϗετଆʹอଘ nίϯςφ಺ͷJava VMͰɼϗετͷJavaόΠφϦΛ࣮ߦ ͜ͷԋश༻ͷzipϑΝΠϧΛμ΢ϯϩʔυ͍ͯͩ͘͠͞

  54. None
  55. None
  56. None
  57. None
  58. None
  59. Πϝʔδͱίϯςφͷ࡟আ

  60. ෆཁͳΠϝʔδͷ࡟আ nΠϝʔδͷϑΝΠϧαΠζ͸͔ͳΓେ͖͍ nෆཁͳ΋ͷ͸࡟আ gcc͸1G Ҏ্ʂ

  61. ෆཁͳΠϝʔδͷ࡟আ ΠϝʔδΛ࡟আ ͢ΔίϚϯυ ࡟আ͢ΔΠϝʔδ໊ ʢඞཁͳΒλά΋ࢦఆʣ

  62. ෆཁͳίϯςφͷ࡟আ n࣮ߦޙ΋ίϯςφ͸ఀࢭͨ͠··࢒͍ͬͯΔ • --rmΦϓγϣϯΛ͚ͭΕ͹ఀࢭ࣌ʹফ͑Δ • --rmΦϓγϣϯ͕ͳ͚Ε͹࢒͍ͬͯΔ ࣮ߦதͷίϯςφΛදࣔ͢ΔίϚϯυ ఀࢭதͷίϯςφΛදࣔ͢ΔίϚϯυ

  63. ෆཁͳίϯςφͷ࡟আ n࣮ߦޙ΋ίϯςφ͸ఀࢭͨ͠··࢒͍ͬͯΔ • --rmΦϓγϣϯΛ͚ͭΕ͹ఀࢭ࣌ʹফ͑Δ • --rmΦϓγϣϯ͕ͳ͚Ε͹࢒͍ͬͯΔ

  64. ෆཁͳίϯςφͷ࡟আ nෆཁͳίϯςφ͸࡟আ͢Δ • ϗετͷϝϞϦͳͲΛѹॖͯ͠͠·͏ ίϯςφΛ࡟আ ͢ΔίϚϯυ ࡟আ͢ΔίϯςφͷIDΛࢦఆ

  65. %PDLFS*B$ n IaC • Infrastructure as Code • ؀ڥߏஙʢΠϯϑϥઃఆʣΛίʔυͰߦ͏ n

    dockerfile • ؀ڥߏஙͷͨΊͷઃఆϑΝΠϧ n ؀ڥ • ։ൃ؀ڥɼ࣮ߦ؀ڥɼetc • gccͱJavaͷ৔߹ • gcc΍JavaͷίϯύΠϥͷΠϯετʔϧ΍࣮ߦ؀ڥͷ੔උ͸खؒ • dockerͳΒʮίϯύΠϥͷΠϯετʔϧʯͱ͍͏؀ڥߏங͸ෆཁ • docker͑͞ಈ͚͹Ͳ͜Ͱ΋OK • “Build and Ship any Application Anywhere”, https://hub.docker.com • PaaS্Ͱಈ͔ͤΔͷͰɼ։ൃ؀ڥʹσϓϩΠ؀ڥʹͳΔ
  66. None
  67. ՝୊ nʮԋश1ɿgccʯͱʮԋश2ɿjavaʯΛɼdockerΛ֤ࣗͷPCʹΠϯε τʔϧͯ͠ߦ͏ • docker ps΍docker image lsͳͲͷίϚϯυΛ࢖ͬͯɼ֤खॱͰίϯςφ΍Π ϝʔδΛ֬ೝ͢Δ͜ͱ

  68. ૝ఆࢼݧ໰୊ nԾ૝Խͱ͸Կ͔ɼ·ͨͦͷछྨΛઆ໌ͤΑ nίϯςφٕज़ͱ͸Կ͔ɼ·ͨͦͷॏཁੑͱԠ༻Λड़΂Α nҎԼΛߦ͏DockerίϚϯυΛઆ໌ͤΑ • Πϝʔδͷ࡞੒ɾऔಘ • ίϯςφͷ࣮ߦ • ίϯςφͷఀࢭ

    • Πϝʔδͷ࡟আ