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

DockerをHerokuでも

 DockerをHerokuでも

2018年9月5日に開催されたHeroku Meetup #22での発表資料です。

Db3632913b120afe741970435b3baa34?s=128

Mitsuhiro Okamoto

September 05, 2018
Tweet

Transcript

  1. )FSPLVNFFUVQ ˑ)FSPLV .BTBNVOF˒ %PDLFS׾)FSPLVד׮ .JUTVIJSP0LBNPUP !NJUTVIJSP

  2. 荈䊹稱➜ .JUTVIJSP0LBNPUP 䀤劤 ⯍峔 4FOJPS%FWFMPQFS&WBOHFMJTU 4BMFTGPSDF 㸚⪒眔㔲 )FSPLV -JHIUOJOH 4BMFTGPSDF

    .VMF4PGU
  3. ➙傈䪔ֲⰻ㺁 • %PDLFS,VCFSOFUFT LT ׾ֶׁ׵ְ • )FSPLVד %PDLFS׾䪔ֲחכ • LT㼎䘔כ

    %PDLFS׾)FSPLVד׮
  4. ֶׁ׵ְ %PDLFSהכ رؿ؋ؙزأةٝت٦سך ؝ٝذش㘗⟎䟝橆㞮

  5. %PDLFSהכ • ؝ٝذش㘗ך⟎䟝⻉橆㞮׾䲿⣘ׅ׷ؔ٦فٝا٦أاؿزؐؑ، • (P鎉铂ד㹋鄲 • 植㖈ך؝ٝذش⟎䟝⻉חֶֽ׷رؿ؋ؙز • $/$'ך$POUBJOFS3VOUJNF*OUFSGBDFח彊䬿

  6. 䖞勻ך)ZQFSWJTPS㘗ה嫰ץג٥٥ 䬄韋⻉ך䏝さְָ넝ְךדծٔا٦أ׾⸬桦ⵃ欽דֹ׷ Docker   Docker    https://knowledge.sakura.ad.jp/13265/

  7. %PDLFS&OHJOF "1*װ $-*׮䲿⣘ׁ׸فؚٗٓوـٕח盖椚 Docker Overview https://docs.docker.com/engine/docker-overview/

  8. ,VCFSOFUFTהכ • $MPVE/BUJWF$PNQVUJOH'PVOEBUJPO $/$' ָ䲿⣘ׅ׷ ؝ٝذش盖椚ىسٕؐؑ، • رفٗ؎ծأ؛٦ٕծٗ٦ٕ،ؐز׾荈⹛⻉ • ؔ٦زؼ٦ؚٔٝծؔ٦زأ؛٦ٕ

    • (PPHMFָꟚ涪׃$/$'ָ⥂㸚 • %PDLFS؝ٝذش׾⸬桦涸ח盖椚٥麊欽דֹ׷
  9. ,VCFSOFUFTד⤑ⵃחז׷ֿה ؙٓأة盖椚ծ،فٔךرفٗ؎ծأ؛٦ٕծ刿倜

  10. )FSPLVך➬穈׫ה⡂גְ׷ %ZOPTBOEUIF%ZOP.BOBHFS

  11. %PDLFS ,VCFSOFUFTך1SPT$POT • ⵃ挿 • 噟歲垥彊 • ➭ךؙٓؐسד׮ⵃ欽〳腉 • ٗ٦ٕؕꟚ涪׮ろ׭ג窟♧ׁ׸׋橆㞮圓眠倯岀

    • كٝت٦ٗحؙ؎ٝז׃ • طحزٙ٦ؙךٕ٦ذ؍ؚٝזו׮厫鮾 • 铬겗 • ⴱ㔐ך橆㞮圓眠װ嚊䙀ך㷕统ָ撕꧟ • ZBNMך㠖 • ֻ֮תד؝ٝذشךؔ٦؛أزٖ٦ءّٝך׫ • "EEPO • $*
  12. None
  13. %PDLFS PO)FSPLV )FSPLVד%PDLFS׾⢪ֲ

  14. 剑ⴱך%PDLFS؟ه٦ز  IFSPLV EPDLFSSFMFBTF • ؎ً٦آ׾IFSPLVDFEBS PS)FSPLV ח寸׭䩧׍ד%PDLFSGJMF׾欰䧭׃ծ ٗ٦ٕؕדךꟚ涪ך׫׾%PDLFS㼎䘔ׅ׷ •

    ٔٔ٦أ儗ח؝وٝسדBQQꂁ♴׾SFMFBTF"1*ד4MVHה׃גرفٗ؎ ♧殢剑ⴱך%PDLFS؟ه٦ز倯䒭 植㖈כꬊ䱿㤺 $ heroku docker:release $ heroku docker:init $ heroku docker:start https://blog.heroku.com/introducing_heroku_docker_release_build_deploy_heroku_apps_with_docker
  15. %PDLFS%FQMPZT $POUBJOFS3FHJTUSZ3VOUJNF • )FSPLV荈魦ָ%PDLFS$POUBJOFS3FHJTUSZ׾مأز • )FSPLVָرفٗ؎欽ח(JU׾مأز׃גְ׷ךהず圫 • $POUBJOFS3FHJTUSZפךؚٗ؎ٝ • %PDLFS#VJME1VTI

    植㖈כ)FSPLV %PDLFS؟ه٦ز $ heroku container:login $ heroku container:push web $ heroku container:release web
  16. )FSPLV1JQFMJOFTה%PDLFS׾⢪ֲ IFSPLVZNM EFWFMPQFSQSFWJFX setup: addons: - plan: heroku-postgresql as: DATABASE

    config: S3_BUCKET: my-example-bucket build: docker: web: Dockerfile worker: worker/Dockerfile config: FOO: bar release: command: - ./deployment-tasks.sh • 倜׃ְ)FSPLVךوصؿؑأزؿ؋؎ٕ • 1SPDGJMFװBQQKTPOח鎸鶢דֹ׷ⰻ㺁׾ ZBNMד㹀纏דֹ׷ • SVOךⰻ㺁 • QSF QPTU • DPOGJH • BEEPOT • CVJME • MBOHVBHF • 植㖈כ+BWBPS3VCZך׫ • %PDLFSךⵃ欽׮〳腉 • )FSPLV$*כת׌劢㼎䘔
  17. ׉ך➭%PDLFS׾)FSPLVחرفٗ؎ׅ׷ꥷך岣䠐挿 • &9104&ךꬊ؟ه٦ز  1035׾#JOEJOHׅ׷ֿהח㢌⻉כ搀׃ • /FUXPSLMJOLJOH׮ꬊ؟ه٦ز • &/7כ؟ه٦ز •

    ٗ٦ٕؕדכFOW׾⢪ְծEPDLFSJHOPSF׾⢪׏ג)FSPLV♳דכ)FSPLV$POGJH׾⢪ֲ • $.%ָ䗳갭 • %PDLFSך㜥さծ،فٔ؛٦ءّٝךSVO؝وٝسכֿֿח鎸鶢 • 70-6.& 45014*(/"- 4)&-- )&"-5)$)&$,זו׮ ꬊ؟ه٦ز )FSPLVך،٦ؗذؙثٍחさ׻זְ堣腉כ؟ه٦زꤐ㢩
  18. %PDLFS׌ֽׄׯזֻגLT׮)FSPLVד⢪ְ׋ְ • 植朐דכ؟ه٦ز搀׃ • ׃ַ׃孡חז׷هأز • IUUQTCMPHIFSPLVDPNEJTTFDUJOHLVCFSOFUFTEFQMPZNFOUT • 䔲搫&OHJOFFSJOHث٦يחכLTךFYQFSU׮㖈硂׃גְ׷ •

    ➙䖓ח劍䖉 (Kubernetes deployment)
  19. ➙傈ךתה׭ )FSPLVד׮%PDLFS⢪ִתׅ״1JQFMJOFT׮㼎䘔幥׫

  20. thank y u ֮׶ָהֲ׀ְׂת׃׋