Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
STNSとDocker
Search
Kazuhiko Yamashita
April 23, 2016
1
1.5k
STNSとDocker
Kazuhiko Yamashita
April 23, 2016
Tweet
Share
More Decks by Kazuhiko Yamashita
See All by Kazuhiko Yamashita
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
Tuning GraphQL on Rails
pyama86
2
1.2k
ttlcacheのここがスゴい
pyama86
1
71
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
470
実践ARMアーキテクチャ移行
pyama86
2
2.2k
リモートワーク時代の守護神 PHP開発者のためのセキュリティ強化術
pyama86
3
1k
実践DevSecOps~クラウドネイティブとオンプレミスの間から~
pyama86
1
65
ペパボOpenTelemetry革命
pyama86
2
2k
Site Reliability Engineering for GMO
pyama86
10
1.3k
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Navigating Team Friction
lara
183
14k
Happy Clients
brianwarren
98
6.7k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Practical Orchestrator
shlominoach
186
10k
Transcript
य़ͷཅؾʹ༠ΘΕͯ STNSͱDocker
hi! GMO Pepabo, Inc. ϗεςΟϯάࣄۀ෦ ϜʔϜʔυϝΠϯάϧʔϓ γχΞΤϯδχΞ @pyama86
STNS ɾLinuxϢʔβʔɺάϧʔϓͷ໊લղܾ ɾSSHϩάΠϯ࣌ͷެ։伴ͷऔಘ ɾSudoύεϫʔυͷೝূ
STNS ɾTOMLܗࣜͷઃఆϑΝΠϧ ɹˠγϯϓϧͳཧ ɾrhel,debianͷϦϙδτϦఏڙ ɾx86_64,i386ͷαϙʔτ [users.example] id = 1001 group_id
= 1001 keys = ["ssh-rsa XXXXX…"] [groups.example] id = 1001 users = ["example"]
ෳڥΛαϙʔτ ↓ ӡ༻ෛՙ͕ߴ·Δ
LinuxϛυϧΣΞͷ߹ ɾෳͷOSɾΞʔΩςΫνϟͰͷಈ࡞Λอূ ɾෳͷܗࣜͷύοέʔδϯάʹରԠ(rpm,deb) ɾLinuxͷࠜװͷػೳͰ͋ΔͨΊαʔϏεஅ ڐ͞Εͳ͍
ϦϦʔεϑϩʔ 1.push 2.webhook 3.CI 4.test deploy 5.install test 6.integration test
7.producion deploy
Docker
ϦϦʔεϑϩʔ 1.push 2.webhook 3.CI 4.test deploy 5.install test 6.integration test
7.producion deploy Docker
ׂ͝ͱʹΠϝʔδΛ͚Δ rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg
debian-i386-build debian-i386-test debian-i386-pkg rhel-x86-chef rhel-i386-chef debian-x86-chef debian-i386-chef 16ύλʔϯ×2(server,client)
DRY
Base STEP1:ΠϝʔδཧΛೋஈ֊ʹ rhel-x86 rhel-i386 debian-i386 debian-x86 Πϯετʔϧ͢ΔϛυϧΣΞ ෦ઃఆΛἧ͑ɺΞʔΩςΫνϟ ʹґଘ͠ͳ͍ૢ࡞ΛՄೳͱ͢Δ concreate
rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg debian-i386-build debian-i386-test debian-i386-pkg ϕʔεΠϝʔδ͔Βׂ͝ͱʹ ΠϝʔδΛ࡞͢Δ
STEP2:ERBͰDockerfileͰग़དྷΔ͜ͱΛ૿͢ ɾdocker/centos-ci.erb DockerfileͷFROMʹมΛࢦఆͰ͖ͳ͍ͷͰ ERBͰςϯϓϨʔτԽ͢Δ
STEP3:RakeͰBuild͢Δ ɾRakefile Rake Ruby Ͱॻ͔ΕͨϏϧυπʔϧɻ ERBͱ߹ΘͤΔ͜ͱͰॏෳΛݮΒ͠ɺλεΫΛఆٛ͢Δ͜ͱ͕ग़དྷ·͢ɻ
Dockerfile rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg
debian-i386-build debian-i386-test debian-i386-pkg bin/rake build bin/rake test bin/rake pkg ׂ͝ͱʹ1ίϚϯυͰશͯͷOSɺ ΞʔΩςΫνϟͰ࣮ߦͰ͖ΔΑ͏ʹͳΔ
͞Βʹ
Travis CIͳΒDockerಈ͘ ɾύοέʔδ࡞ ɾΠϯετʔϧ ɾServerspecͰల։ޙͷঢ়ଶΛςετ ɹ →ෳͷOSɺෳͷΞʔΩςΫνϟΛCI
࠷ޙʹ ɾDockerΛར༻͢ΔͱෳͷڥΛखܰʹ४උ͢Δ ͜ͱ͕ग़དྷΔ͕ɺखܰ͞Ώ͑ʹDRYݪଇʹ͕ͪ͠ ɾRakeͱΈ߹Θͤɺಉ͡ఆٛΛߦΘͳ͍ ɾϕʔεΠϝʔδͱ۩Πϝʔδͷೋஈ֊ʹ͚Δ ͜ͱͰπʔϧͱΈ߹Θͤ͘͢ͳΔ ɾSTNSɺຊʹศར͔ͩΒͬͨ΄͏͕͍͍
͓ෲ͍ͨ͢ΆΑ